Class Diary

java.lang.Object
  extended by Diary

public class Diary
extends java.lang.Object

A class Diary that represents a "diary" of library item reservations. The diary is structured as a Map of entries in which each entry corresponds to a specific day. As the map is not accessed in a sequential fashion, it doesn't matter whether the actual map class is a TreeMap or a HashMap.

Author:
D E Newton

Constructor Summary
Diary()
          Constructor for objects of class Diary
 
Method Summary
 void addReservation(LibraryReservation itemReservation)
          Method for adding a reservation to the diary.
 void deleteReservation(LibraryReservation itemReservation)
          Method for deleting a reservation from the diary.
 LibraryReservation[] getReservations(java.util.Date date)
          Accessor method for returning all reservations that have entries in the diary for a particular date.
 void printEntries(java.util.Date startDate, java.util.Date endDate)
          Method for displaying the reservations between specified dates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Diary

public Diary()
Constructor for objects of class Diary

Method Detail

addReservation

public void addReservation(LibraryReservation itemReservation)
Method for adding a reservation to the diary.


deleteReservation

public void deleteReservation(LibraryReservation itemReservation)
Method for deleting a reservation from the diary.


getReservations

public LibraryReservation[] getReservations(java.util.Date date)
Accessor method for returning all reservations that have entries in the diary for a particular date.

Returns:
an array of reservations, or null if no entry for that date

printEntries

public void printEntries(java.util.Date startDate,
                         java.util.Date endDate)
Method for displaying the reservations between specified dates.