| java.util.HashMap com.sun.portal.common.collection.TimeBoundHashMap
TimeBoundHashMap | public class TimeBoundHashMap extends HashMap (Code) | | TimeBoundHashMap is a HashMap sub class that purges entries using
a last accessed time mechanism.
The time out control is done when using the accessor methods of the Map,
no extra Thread is used for it.
This class is not Thread-safe, if a TimeBoundHashMap instance is to be
used in a multithreaded fashion it should be wrapped with a synchronized
Map (see the Collections.synchronizedMap() method).
author: Alejandro Abdelnur |
Constructor Summary | |
public | TimeBoundHashMap(int timeOut) Creates an empty TimeBoundHashMap with a given last accessed time out. | public | TimeBoundHashMap(int initialCapacity, int timeOut) Creates an empty TimeBoundHashMap with a specific initial capacity
and a given last accessed time out. | public | TimeBoundHashMap(int initialCapacity, float loadFactor, int timeOut) Creates an empty TimeBoundHashMap with a specific initial capacity,
a given load factor and a given last accessed time out. |
Method Summary | |
public Set | entrySet() Adds time out control and delegates to HashMap.entrySet() method. | public Object | get(Object key) Adds time out control and delegates to HashMap.get() method. | public Object | put(Object key, Object value) Adds time out control and delegates to HashMap.put() method. | public Object | remove(Object key) Adds time out control and delegates to HashMap.remove() method. |
TimeBoundHashMap | public TimeBoundHashMap(int timeOut)(Code) | | Creates an empty TimeBoundHashMap with a given last accessed time out.
Parameters: timeOut - last accessed time out in seconds. |
TimeBoundHashMap | public TimeBoundHashMap(int initialCapacity, int timeOut)(Code) | | Creates an empty TimeBoundHashMap with a specific initial capacity
and a given last accessed time out.
Parameters: initialCapacity - initial capacity of the Map. Parameters: timeOut - last accessed time out in seconds. |
TimeBoundHashMap | public TimeBoundHashMap(int initialCapacity, float loadFactor, int timeOut)(Code) | | Creates an empty TimeBoundHashMap with a specific initial capacity,
a given load factor and a given last accessed time out.
Parameters: initialCapacity - initial capacity of the Map. Parameters: loadFactor - load factor for the Map. Parameters: timeOut - last accessed time out in seconds. |
entrySet | public Set entrySet()(Code) | | Adds time out control and delegates to HashMap.entrySet() method.
|
get | public Object get(Object key)(Code) | | Adds time out control and delegates to HashMap.get() method.
|
remove | public Object remove(Object key)(Code) | | Adds time out control and delegates to HashMap.remove() method.
|
|
|