You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.md 1.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Documentations
  2. - [Book](#book)
  3. - [Book Factory](#book-factory)
  4. # Book
  5. ## Constructors
  6. | Method | Description |
  7. |:-------|:------------|
  8. | Book(int id) | Create a book with a specific id |
  9. | Book(String title, int id) | Create a book with specific id and title |
  10. ## Functions
  11. | Return | Method | Description |
  12. |:-------|:-------|:------------|
  13. | String | getTitle() | Returns the title of the book |
  14. | String | getStatus() | Returns the status of the book |
  15. | String | getId() | Returns the id of the book |
  16. | void | setTitle() | Set the title of the book |
  17. | boolean | rent(int[] dueDate) | Returns if the rent action is successful and set the due date to the given input |
  18. | void | returned() | Return the book |
  19. | double | overdueFine(int[] currentDay) | Calculate and return the amount of fine to be charged<br>(Fine rate is 0.25 per day; Max fine is 5) |
  20. # Book Factory
  21. ## Constructors
  22. | Method | Description |
  23. |:-------|:------------|
  24. | BookFactory() | Creates an empty BookFactory |
  25. ## Functions
  26. | Return | Method | Description |
  27. |:-------|:-------|:------------|
  28. | Book | newBook(String title) | Creates a new Book with the given title and returns it |
  29. | Book | getBook(int index) | Returns the book of the given index if it exist, else throw null pointer exception |
  30. | Book | getBook(String title) | Returns the book of the given title if it exist, else throw null pointer exception |
  31. | void | update(Book newbook) | Replaces the existing book of the same id with this new one |