com.cassinidivision.core.foundation
Class CassiniExpiringDictionary

java.lang.Object
  extended bycom.cassinidivision.core.foundation.CassiniExpiringDictionary

public class CassiniExpiringDictionary
extends Object

A dictionary/hashtable wrapper class that expires its contents over time.


Constructor Summary
CassiniExpiringDictionary(int someDays, int someHours, int someMinutes)
          Creates a blank dictionary with the contents are set to expire according to the time details provided.
 
Method Summary
 void expireNow()
          Expire all objects in the dictionary immediately.
 Object objectForKey(String aKey)
          Return the object identified by the key provided (if the object has not yet expired).
 void setObjectForKey(Object anObject, String aKey)
          Associate an object with a key value in the dictionary.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CassiniExpiringDictionary

public CassiniExpiringDictionary(int someDays,
                                 int someHours,
                                 int someMinutes)
Creates a blank dictionary with the contents are set to expire according to the time details provided.

Parameters:
someDays - Expire content this number of days into the future.
someHours - Expire content this number of hours into the future.
someMinutes - Expire content this number of minutes into the future.
Method Detail

objectForKey

public Object objectForKey(String aKey)
Return the object identified by the key provided (if the object has not yet expired).

Parameters:
aKey - The key in question.
Returns:
The requested object, or null if the time period has expired/the key value is unknown.

setObjectForKey

public void setObjectForKey(Object anObject,
                            String aKey)
Associate an object with a key value in the dictionary.

Parameters:
anObject - The object in question.
aKey - The key in question.

expireNow

public void expireNow()
Expire all objects in the dictionary immediately.