| java.util.HashMap com.sun.portal.providers.simplewebservice.util.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).
|
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 int | getTimeOut() Gets the cache time out. | 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. | public void | setTimeOut(int timeOut) Resets the cache time out. |
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.
|
getTimeOut | public int getTimeOut()(Code) | | Gets the cache time out.
|
remove | public Object remove(Object key)(Code) | | Adds time out control and delegates to HashMap.remove() method.
|
setTimeOut | public void setTimeOut(int timeOut)(Code) | | Resets the cache time out.
ONLY to be called before the put and get are called.
Parameters: timeOut - last accessed time out in seconds. |
|
|