public class Book extends Object
Constructor and Description |
---|
Book(int id)
Create new Book with given id (Usually used as placeholders)
|
Book(int id,
String title,
String status,
int[] dueDate)
Create new Book with given id, title, status and dueDate (Usually used for initialization from database)
|
Book(String title,
int id,
String status)
Create new Book with given title, id and status (Usually used for new Book creation)
|
Modifier and Type | Method and Description |
---|---|
int[] |
getDueDate()
Returns the due date of the Book
|
int |
getId()
Returns the id of the Book
|
String |
getStatus()
Returns the status of the Book
|
String |
getTitle()
Returns the title of the Book
|
double |
overdueFine(int[] currentDay)
Calculate the overdue fine
|
boolean |
rent(int[] dueDate)
Call to rent book, return if renting is successful
|
void |
returned()
Return the Book to the shelf
|
void |
setTitle(String title)
Set the title to the given title
|
public Book(int id)
id
- Identification number of the Bookpublic Book(String title, int id, String status)
title
- Title of the Bookid
- Identification number of the Bookstatus
- Status of the Bookpublic Book(int id, String title, String status, int[] dueDate)
id
- Identification number of the Booktitle
- Title of the Bookstatus
- Status of the BookdueDate
- Due date of the Bookpublic String getTitle()
public String getStatus()
public int getId()
public int[] getDueDate()
public void setTitle(String title)
title
- The new title of the Bookpublic boolean rent(int[] dueDate)
dueDate
- The new due date of the Bookpublic void returned()
public double overdueFine(int[] currentDay)
currentDay
- Today's dateCopyright © 2017. All rights reserved.