|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.MapWrapper
org.pf.util.TemporaryMap
public class TemporaryMap
This implementation of a Map behaves like a Hashtable except that it associates a timestamp with each entry. Periodically it checks all its entries' timestamp against an expire period. If an entry is expired it will be automatically removed. Therefore all elements just live temporarily in this map.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
TemporaryMap(long expiresAfterMs,
long checkAfterMs)
Initialize the new instance with values that define the expiration of any object in the map and the interval for checking if expired objects are in the map. |
|
| Method Summary | |
|---|---|
boolean |
canBeTriggeredBy(Trigger trigger)
FOR INTERNAL USE ONLY! |
boolean |
containsKey(java.lang.Object key)
This method returns true, if the given key can be found in this map. |
boolean |
containsValue(java.lang.Object value)
This method returns true, if the given value is a value of any entry in this map. |
java.util.Set |
entrySet()
This method automatically touches every entry, so that its expire period starts anew. |
java.lang.Object |
get(java.lang.Object key)
Returns the object that was registered under the specified key. |
java.util.Set |
keySet()
Returns all keys in this map. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts the given value under the specified key into the map. |
void |
putAll(java.util.Map map)
Each entry of the given map will be added. |
java.lang.Object |
remove(java.lang.Object key)
Remove the entry with the given key and return the associated object. |
boolean |
triggeredBy(Trigger trigger)
FOR INTERNAL USE ONLY! |
java.util.Collection |
values()
Returns all values of the map. |
| Methods inherited from class org.pf.util.MapWrapper |
|---|
clear, isEmpty, size |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public TemporaryMap(long expiresAfterMs,
long checkAfterMs)
expiresAfterMs - Defines after what time (milliseconds) an unsued
object must be removed (must be >= 100)checkAfterMs - Defines the interval for lookup and remove expired
objects (must be >= 10)| Method Detail |
|---|
public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.MapcontainsKey in class MapWrapperMap.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.MapcontainsValue in class MapWrapperMap.containsValue(Object)public java.util.Set entrySet()
entrySet in interface java.util.MapentrySet in class MapWrapperMap.entrySet()public java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapget in class MapWrapperMap.get(Object)public java.util.Set keySet()
keySet in interface java.util.MapkeySet in class MapWrapperMap.keySet()
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class MapWrapperMap.put(Object, Object)public void putAll(java.util.Map map)
putAll in interface java.util.MapputAll in class MapWrapperMap.putAll(Map)public java.util.Collection values()
values in interface java.util.Mapvalues in class MapWrapperMap.values()public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapremove in class MapWrapperkey - The key of the entry to be removed
Map.remove(Object)public boolean canBeTriggeredBy(Trigger trigger)
canBeTriggeredBy in interface TriggerClienttrigger - The trigger that calls this method
TriggerClient.canBeTriggeredBy(Trigger)public boolean triggeredBy(Trigger trigger)
triggeredBy in interface TriggerClienttrigger - The trigger that calls this method
TriggerClient.triggeredBy(Trigger)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||