|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TimeoutMap<K,V>
Represents a thread safe map of values which timeout after a period of inactivity.
| Method Summary | |
|---|---|
V |
get(K key)
Looks up the value in the map by the given key. |
Object[] |
getKeys()
Returns a copy of the keys in the map |
void |
onEviction(K key,
V value)
Callback when the value has been evicted |
void |
purge()
Purges any old entries from the map |
void |
put(K key,
V value,
long timeoutMillis)
Adds the key value pair into the map such that some time after the given timeout the entry will be evicted |
void |
remove(K key)
Removes the object with the given key |
int |
size()
Returns the size of the map |
| Methods inherited from interface java.lang.Runnable |
|---|
run |
| Method Detail |
|---|
V get(K key)
key - the key of the value to search for
Object[] getKeys()
int size()
void put(K key,
V value,
long timeoutMillis)
key - the keyvalue - the valuetimeoutMillis - timeout in millis
void onEviction(K key,
V value)
key - the keyvalue - the valuevoid remove(K key)
key - key for the object to removevoid purge()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||