|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.util.ExpirationHashtable
public class ExpirationHashtable
This is an implementation of a simple hashtable which removes its elements after a given timeout period. The expiration timeout is restarted on each lookup of an object.
| Constructor Summary | |
|---|---|
ExpirationHashtable(long defaultTimeout)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
containsKey(java.lang.Object key)
This method checks, whether the passed object is used as key in this hashtable. |
java.util.Enumeration |
elements()
Returns an enumeration of the values in this hashtable. |
java.util.Set |
entrySet()
Returns the entry set of the table. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which the specified key is mapped in this hashtable. |
java.util.Enumeration |
keys()
Returns an enumeration of the keys in this hashtable. |
java.util.Set |
keySet()
Returns the key set of the table. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Maps the specified key to the specified value in this hashtable. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
long timeout)
Maps the specified key to the specified value in this hashtable. |
java.lang.Object |
remove(java.lang.Object key)
This method removes the object registered with the given key and returns it. |
void |
setDisposalListener(DisposalListener disposalListener)
This method sets a disposal listener for this container. |
int |
size()
Returns the current size of the hashtable. |
java.util.Collection |
values()
Returns the values of the table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExpirationHashtable(long defaultTimeout)
defaultTimeout - The timeout in milliseconds, after which an object should
be removed from the hashtable. Each lookup of the object
restarts the timeout period.| Method Detail |
|---|
public boolean containsKey(java.lang.Object key)
key - The key to check for
public java.util.Set entrySet()
public java.util.Set keySet()
public java.util.Collection values()
public java.util.Enumeration elements()
public java.lang.Object get(java.lang.Object key)
key - A key in the hashtable
public java.util.Enumeration keys()
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
key - the hashtable keyvalue - the value
public java.lang.Object put(java.lang.Object key,
java.lang.Object value,
long timeout)
key - the hashtable keyvalue - the valuetimeout - the timeout in milliseconds, after which the value expires; use 0 for no expiration
public java.lang.Object remove(java.lang.Object key)
key - The key to remove the value for
public void setDisposalListener(DisposalListener disposalListener)
disposalListener - The listener to be calledpublic int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||