|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SessionCache
SessionCache is a general receiving area for data represented as key-value pairs. Entries in a SessionCache may persist for the length of a Virtual Machine's run time, but may be evicted at any time.
Eviction of SessionCache entires is accomplished by controlling the maximum number of entries in the cache. This maximum value is set by callingsetCapacity(int)
. A SessionCache may be implemented with any eviction policy
(including a policy of no eviction). Most implementations evict the eldest entry added to the cache.
Method Summary | |
---|---|
void |
clear()
Removes all entries from the cache. |
boolean |
contains(Object key)
Returns true if the cache contains a specified key, and false if it does not. |
Object |
get(Object key)
Returns a reference to an entry's value in the cache corresponding to a specified key, or null if no entry with that key exists. |
int |
getCapacity()
Returns the maximum number of entires in the cache. |
int |
getEntryCount()
Returns the number of entries currently in the cache. |
Set<Object> |
getKeySet()
Returns a Set view of the keys contained in the cache. |
void |
put(Object key,
Object value)
Adds an entry in the cache with a specified key and value. |
Object |
remove(Object key)
Removes the entry with the specified key from the cache, and returns that entry's value. |
void |
setCapacity(int capacity)
Sets the maximum number of entries in the cache. |
Method Detail |
---|
void clear()
boolean contains(Object key)
key
- the entry key in question.
Object get(Object key)
key
- the entry key to look for.
int getCapacity()
int getEntryCount()
Set<Object> getKeySet()
Set
view of the keys contained in the cache.
Set
view of the keys contained in the cache.void put(Object key, Object value)
key
- the entry's key.value
- the entry's value.Object remove(Object key)
key
- the entry key to look for.
void setCapacity(int capacity)
capacity
- maximum number of enties in the cache.
|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |