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

Variable Index

 o COPIES
 o ISSN
 o KEYWORDS
 o props
 o TITLE

Method Index

 o extProperties()
Returns the extended propterties of this class.
 o getBorrower()
Checks if the item is on loan and if so returns the Borrower, otherwise null.
 o getDueDate()
Checks if the item is on loan and if so returns the due date, otherwise null.
 o getExtendedProperties()
Returns the extended propterties of this class.
 o getLoanPeriod()
Gets the default loan period for this item.
 o loanTo(Borrower)
Adds a record to the loans table in the database using the default due date.
 o loanTo(Borrower, Date)
Adds a record to the loans table in the database.
 o receive()
Checks if the book is overdue then removes the loan record from the database.
 o toString()

Variables

 o props
 protected static int props
 o TITLE
 public static final int TITLE
 o KEYWORDS
 public static final int KEYWORDS
 o COPIES
 public static final int COPIES
 o ISSN
 public static final int ISSN

Methods

 o toString
 public String toString()
Overrides:
toString in class StdLibraryObject
 o getExtendedProperties
 public Object[][] getExtendedProperties()
Returns the extended propterties of this class. Non-static so that it may be overriden.

Overrides:
getExtendedProperties in class StdLibraryObject
 o extProperties
 protected static Object[][] extProperties()
Returns the extended propterties of this class.

 o 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.
 o 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.
 o 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.
 o 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.
 o getLoanPeriod
 public long getLoanPeriod() throws RemoteException
Gets the default loan period for this item.

Returns:
The default loan period in milliseconds.
 o 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