Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class Citation {
- private Pearson[] author;
- private String title;
- private int year;
- public Citation(Pearson[] author, String title, int year) {
- this.author = author;
- this.title = title;
- this.year = year;
- }
- public Pearson[] getAuthor() {
- return author;
- }
- public String getTitle() {
- return title;
- }
- public int getYear() {
- return year;
- }
- public abstract int getPagesCount();
- }
- class Book extends Citation {
- private String publisher;
- private String address;
- private int pagesCount;
- public Book(Pearson[] author, String title, int year, String publisher, String address, int pagesCount) {
- super(author, title, year);
- this.publisher = publisher;
- this.address = address;
- this.pagesCount = pagesCount;
- }
- @Override
- public int getPagesCount() {
- return pagesCount;
- }
- }
- class InCollection extends Book {
- private String bookTitle;
- private Pearson[] editors;
- private int startPage;
- private int endPage;
- public InCollection(Pearson[] author, String title, int year, String publisher, String address, String bookTitle, Pearson[] editors, int startPage, int endPage) {
- super(author, title, year, publisher, address, endPage-startPage);
- this.bookTitle = bookTitle;
- this.editors = editors;
- this.startPage = startPage;
- this.endPage = endPage;
- }
- public String getBookTitle() {
- return bookTitle;
- }
- public Pearson[] getEditors() {
- return editors;
- }
- public int getStartPage() {
- return startPage;
- }
- public int getEndPage() {
- return endPage;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement