25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.5 KiB

Documentations

Book

Constructors

Method Description
Book(int id) Create a book with a specific id
Book(String title, int id) Create a book with specific id and title

Functions

Return Method Description
String getTitle() Returns the title of the book
String getStatus() Returns the status of the book
String getId() Returns the id of the book
void setTitle() Set the title of the book
boolean rent(int[] dueDate) Returns if the rent action is successful and set the due date to the given input
void returned() Return the book
double overdueFine(int[] currentDay) Calculate and return the amount of fine to be charged
(Fine rate is 0.25 per day; Max fine is 5)

Book Factory

Constructors

Method Description
BookFactory() Creates an empty BookFactory

Functions

Return Method Description
Book newBook(String title) Creates a new Book with the given title and returns it
Book getBook(int index) Returns the book of the given index if it exist, else throw null pointer exception
Book getBook(String title) Returns the book of the given title if it exist, else throw null pointer exception
void update(Book newbook) Replaces the existing book of the same id with this new one