gov.nasa.worldwind.cache
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Field Summary | |
|---|---|
protected static int |
DEFAULT_CAPACITY
|
protected BoundedHashMap<Object,Object> |
entries
|
| Constructor Summary | |
|---|---|
BasicSessionCache()
Creates a BasicSessionCache with the default capacity. |
|
BasicSessionCache(int capacity)
Creates a BasicSessionCache with a specified maximum number of entries. |
|
| 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 entries 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int DEFAULT_CAPACITY
protected BoundedHashMap<Object,Object> entries
| Constructor Detail |
|---|
public BasicSessionCache()
public BasicSessionCache(int capacity)
capacity - maximum number of entries in the cache.
IllegalArgumentException - if capacity is negative.| Method Detail |
|---|
public void clear()
clear in interface SessionCachepublic boolean contains(Object key)
contains in interface SessionCachekey - the entry key in question. A null value is not permitted.
IllegalArgumentException - if the key is null.public Object get(Object key)
get in interface SessionCachekey - the entry key to look for.
IllegalArgumentException - if the key is null.public int getCapacity()
getCapacity in interface SessionCachepublic int getEntryCount()
getEntryCount in interface SessionCachepublic Set<Object> getKeySet()
Set view of the keys contained in the cache. The returned set is immutable: changes
to the set are not reflected in the session cache.
getKeySet in interface SessionCacheSet view of the keys contained in the cache.public void put(Object key, Object value)
put in interface SessionCachekey - the entry's key. A null value is not permitted.value - the entry's value. A null value is permitted.
IllegalArgumentException - if the key is null.public Object remove(Object key)
remove in interface SessionCachekey - the entry key to look for.
public void setCapacity(int capacity)
setCapacity in interface SessionCachecapacity - maximum number of enties in the cache.
IllegalArgumentException - if capacity is negative.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||