public final class CacheLRU extends GenericCache
GenericCache
,
Serialized FormDEFAULT_CAPACITY
Constructor and Description |
---|
CacheLRU()
Same as:
|
CacheLRU(int capacity)
Creates a CacheLRU instance with a given cache capacity.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(java.lang.Object key,
java.lang.Object value)
Adds a value to the cache.
|
java.lang.Object |
getElement(java.lang.Object key) |
capacity, isFull, keys, size
public CacheLRU(int capacity)
capacity
- The capacity of the cache.public CacheLRU()
CacheLRU(GenericCache.DEFAULT_CAPACITY);
public java.lang.Object getElement(java.lang.Object key)
getElement
in interface Cache
getElement
in class GenericCache
public final void addElement(java.lang.Object key, java.lang.Object value)
addElement
in interface Cache
addElement
in class GenericCache
key
- The key referencing the value added to the cache.value
- The value to add to the cache.Copyright ? 2000-2003 Apache Software Foundation. All Rights Reserved.