java.lang.ObjectDiary
public class Diary
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.
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 |
---|
public Diary()
Method Detail |
---|
public void addReservation(LibraryReservation itemReservation)
public void deleteReservation(LibraryReservation itemReservation)
public LibraryReservation[] getReservations(java.util.Date date)
public void printEntries(java.util.Date startDate, java.util.Date endDate)