Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private abstract class Citation {
- private Person[] authors;
- private String title;
- private int year;
- public Citation(Person[] authors, String title, int year) {
- this.authors = authors;
- this.title = title;
- this.year = year;
- }
- public Person[] getAuthors() {
- return authors;
- }
- public String getTitle() {
- return title;
- }
- public int getYear() {
- return year;
- }
- public abstract int getPagesCount();
- }
- private class Book extends Citation {
- private String publisher;
- private String address;
- private int pagesCount;
- public Book(Person[] 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;
- }
- }
- private class InCollection extends Book {
- private String bookTitle;
- private Person[] editors;
- private int startPage;
- private int endPage;
- public InCollection(Person[] author, String title, int year, String publisher, String address, String bookTitle, Person[] 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 Person[] getEditors() {
- return editors;
- }
- public int getStartPage() {
- return startPage;
- }
- public int getEndPage() {
- return endPage;
- }
- }
- private class Person {
- String name;
- String surname;
- public Person(String name, String surname) {
- this.name = name;
- this.surname = surname;
- }
- public String getName() {
- return name;
- }
- public String getSurname() {
- return surname;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement