edu.unr.cs.LMS
Class Patron

java.lang.Object
  |
  +--edu.unr.cs.LMS.Patron

public class Patron
extends java.lang.Object

The patron class encapsulates the data and behavior of LMS patrons. Students, Faculty, and Staff are types of patrons and inherit from this class.


Constructor Summary
Patron(java.lang.String name, long homePhone, java.util.Date start, java.util.Date end, java.lang.String street, java.lang.String city, java.lang.String state, long zip)
          Constructs a patron object.
 
Method Summary
 boolean checkout(Resource resourceID)
          Skeleton for checkout.
 long getPatronID()
          Accessor for patronID, private long identifier that uniquely specifies a patron.
 boolean validatePatron(java.util.Date endDate)
          Returns true if the patron's membership has not expired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Patron

public Patron(java.lang.String name,
              long homePhone,
              java.util.Date start,
              java.util.Date end,
              java.lang.String street,
              java.lang.String city,
              java.lang.String state,
              long zip)
Constructs a patron object. Constructs an address object from parameters and initializes class variables.
Parameters:
name - Patron's name as a String in Last, First, MI format
homePhone - Patron's home phone number (3 + 7)
start - The Patron's membership start date as a Date object
end - The Patron's membership end date as a Date object
street - A string specifying patron's home street
city - A string specifying patron's city
state - A string specifying patron's state
zip - A long specifying patron's zip code
Method Detail

validatePatron

public boolean validatePatron(java.util.Date endDate)
Returns true if the patron's membership has not expired. Checked by comparing the input parameter, endDate against the membership expiration date expirationDate. returns true if expirationDate < endDate else false.
Parameters:
endDate - The date (today's) against which to check membership expiration. This is of type java.util.Date.
Returns:
Returns true if expiration date is after endDate. See

checkout

public boolean checkout(Resource resourceID)
Skeleton for checkout. Currently, adds a resourceID object to the resource List.

getPatronID

public long getPatronID()
Accessor for patronID, private long identifier that uniquely specifies a patron.