class Handler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) BookFactory |
books |
private java.util.Calendar |
cal |
(package private) UserFactory |
users |
Constructor and Description |
---|
Handler()
Creates new empty Handler
|
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.String |
bookIdsToTitlesString(int[] bookIDs)
Create a String of all book titles with the given Book ids
|
(package private) boolean |
borrowBook(User user,
Book book)
Given User borrows the given Book
|
private int[] |
calDueDate(int days)
Calculating the due date
|
(package private) int[] |
calDueDate(int days,
int[] date) |
private int[] |
currentDay()
Returns the current date in an int array
|
(package private) boolean |
returnBook(User user,
Book book)
Given User returns the given Book
|
BookFactory books
private java.util.Calendar cal
UserFactory users
java.lang.String bookIdsToTitlesString(int[] bookIDs)
bookIDs
- Array of Book idsboolean borrowBook(User user, Book book)
user
- User borrowing the Bookbook
- Book to be borrowedprivate int[] calDueDate(int days)
days
- Amount of days to be borrowedint[] calDueDate(int days, int[] date)
private int[] currentDay()