All Packages Class Hierarchy This Package Previous Next Index
Class org.dorm4.fls.Item
java.lang.Object
|
+----org.dorm4.fls.StdLibraryObject
|
+----org.dorm4.fls.Item
- public abstract class Item
- extends StdLibraryObject
Item
object represents an item in the library. This is an
abstract class that must be overridden to provide an actual type that
may be used by the library.
- See Also:
- Book
-
COPIES
-
-
ISSN
-
-
KEYWORDS
-
-
props
-
-
TITLE
-
-
extProperties()
- Returns the extended propterties of this class.
-
getBorrower()
- Checks if the item is on loan and if so returns the
Borrower
, otherwise null.
-
getDueDate()
- Checks if the item is on loan and if so returns the due date, otherwise null.
-
getExtendedProperties()
- Returns the extended propterties of this class.
-
getLoanPeriod()
- Gets the default loan period for this item.
-
loanTo(Borrower)
- Adds a record to the loans table in the database using the default due date.
-
loanTo(Borrower, Date)
- Adds a record to the loans table in the database.
-
receive()
- Checks if the book is overdue then removes the loan record from the database.
-
toString()
-
props
protected static int props
TITLE
public static final int TITLE
KEYWORDS
public static final int KEYWORDS
COPIES
public static final int COPIES
ISSN
public static final int ISSN
toString
public String toString()
- Overrides:
- toString in class StdLibraryObject
getExtendedProperties
public Object[][] getExtendedProperties()
- Returns the extended propterties of this class. Non-static
so that it may be overriden.
- Overrides:
- getExtendedProperties in class StdLibraryObject
extProperties
protected static Object[][] extProperties()
- Returns the extended propterties of this class.
loanTo
public void loanTo(Borrower borrower,
Date dueDate) throws CannotAllowException, RecordNotFoundException, RemoteException
- Adds a record to the loans table in the database.
- Parameters:
- borrower - The person checking the book out.
- dueDate - The date the book is due.
- Throws: CannotAllowException
- Thrown if the book is already checked
out or if the borrower doesn't have permission.
- Throws: RecordNotFoundException
- Thrown if the record could not be found.
loanTo
public void loanTo(Borrower borrower) throws CannotAllowException, RecordNotFoundException, RemoteException
- Adds a record to the loans table in the database using the default due date.
- Parameters:
- borrower - The person checking the book out.
- Throws: CannotAllowException
- Thrown if the book is already checked
out or if the borrower doesn't have permission.
- Throws: RecordNotFoundException
- Thrown if the record could not be found.
receive
public Borrower receive() throws OverdueException, RecordNotFoundException, RemoteException
- Checks if the book is overdue then removes the loan record from the database.
- Returns:
- The
Borrower
the item is on loan to or
null
if it's not on loan.
- Throws: OverdueException
- Thrown if the book is overdue.
- Throws: RecordNotFoundException
- Thrown if the borrower is not found
- Throws: RecordNotFoundException
- Thrown if the record could not be found.
getDueDate
public Date getDueDate() throws RemoteException
- Checks if the item is on loan and if so returns the due date, otherwise null.
- Returns:
- The due date of the item on loan or
null
if it's not on loan.
getLoanPeriod
public long getLoanPeriod() throws RemoteException
- Gets the default loan period for this item.
- Returns:
- The default loan period in milliseconds.
getBorrower
public Borrower getBorrower() throws RemoteException
- Checks if the item is on loan and if so returns the
Borrower
, otherwise null.
- Returns:
- The
Borrower
of the item on loan or null
if it's not on loan.
All Packages Class Hierarchy This Package Previous Next Index