net.datacrow.core.objects
Class Loan

java.lang.Object
  extended by net.datacrow.core.objects.DcObject
      extended by net.datacrow.core.objects.Loan
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<DcObject>

public class Loan
extends DcObject

Represents a loan.

Author:
Robert Jan van der Waals
See Also:
Serialized Form

Field Summary
static int _A_STARTDATE
           
static int _B_ENDDATE
           
static int _C_CONTACTPERSONID
           
static int _D_OBJECTID
           
static int _E_DUEDATE
           
 
Fields inherited from class net.datacrow.core.objects.DcObject
_ID, _SYS_AVAILABLE, _SYS_CONTAINER, _SYS_CREATED, _SYS_DISPLAYVALUE, _SYS_EXTERNAL_REFERENCES, _SYS_FILEHASH, _SYS_FILEHASHTYPE, _SYS_FILENAME, _SYS_FILESIZE, _SYS_LENDBY, _SYS_LOANDAYSTILLOVERDUE, _SYS_LOANDUEDATE, _SYS_LOANDURATION, _SYS_MODIFIED, _SYS_MODULE, _SYS_SERVICE, _SYS_SERVICEURL, _VALUE, children
 
Constructor Summary
Loan()
          Creates a new instance.
 
Method Summary
 java.lang.Long getDaysLoaned()
          The duration of the loan.
 java.lang.Long getDaysTillOverdue()
          Indicates the days till the loan is overdue.
 java.util.Date getDueDate()
           
 DcObject getPerson()
          Retrieves information on the person who lend the item.
 void initializeReferences()
          Loads the actual reference information.
 boolean isAvailable(java.lang.String ID)
          Indicates if the given item is available.
 boolean isOverdue()
          Calculates the due date against the current date to determine if the loan is overdue.
 
Methods inherited from class net.datacrow.core.objects.DcObject
addChild, addExternalReference, addRequest, applyEnhancers, applyTemplate, applyTemplate, beforeDelete, beforeSave, checkIntegrity, clearValues, clone, compareTo, copy, copyImage, createIcon, delete, destroy, equals, executeRequests, finalize, flushImages, getChildren, getCurrentChildren, getDatabaseFieldCount, getDatabaseFieldName, getDefaultSortFieldIdx, getDisplayFieldIdx, getDisplayString, getExternalReference, getField, getFieldIndices, getFields, getFieldType, getFileField, getFilename, getIcon, getID, getLabel, getMaxFieldLength, getModule, getName, getNormalizedString, getNotSearchableFields, getParentID, getParentReferenceFieldIndex, getRequests, getSystemDisplayFieldIdx, getTableName, getTableShortName, getValue, getValueDef, getValues, hashCode, hasPrimaryKey, initializeImages, initializeReferences, isChanged, isChanged, isDestroyed, isEnabled, isFilled, isLastInLine, isLoaded, isNew, isRequired, isSearchable, isUnique, isUpdateGUI, load, load, loadChildren, markAsChanged, markAsUnchanged, merge, release, reload, removeChildren, removeRequests, saveNew, saveUpdate, saveUpdate, setChanged, setChildren, setIDs, setLastInLine, setLoanInformation, setLoanInformation, setNew, setUpdateGUI, setValidate, setValue, setValueForColumn, setValueForName, setValueLowLevel, toString, validateRequiredFields
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_A_STARTDATE

public static final int _A_STARTDATE
See Also:
Constant Field Values

_B_ENDDATE

public static final int _B_ENDDATE
See Also:
Constant Field Values

_C_CONTACTPERSONID

public static final int _C_CONTACTPERSONID
See Also:
Constant Field Values

_D_OBJECTID

public static final int _D_OBJECTID
See Also:
Constant Field Values

_E_DUEDATE

public static final int _E_DUEDATE
See Also:
Constant Field Values
Constructor Detail

Loan

public Loan()
Creates a new instance.

Method Detail

initializeReferences

public void initializeReferences()
Description copied from class: DcObject
Loads the actual reference information. Uses the Data Manager to retrieve the references and stores them in this object.

Overrides:
initializeReferences in class DcObject

isAvailable

public boolean isAvailable(java.lang.String ID)
Indicates if the given item is available.

Parameters:
ID -

getPerson

public DcObject getPerson()
Retrieves information on the person who lend the item.

Returns:
The person or null.

getDueDate

public java.util.Date getDueDate()

getDaysTillOverdue

public java.lang.Long getDaysTillOverdue()
Indicates the days till the loan is overdue. A negative value indicates the loan is overdue.


isOverdue

public boolean isOverdue()
Calculates the due date against the current date to determine if the loan is overdue.


getDaysLoaned

public java.lang.Long getDaysLoaned()
The duration of the loan.