org.apache.oro.util
Class GenericCache
java.lang.Object
org.apache.oro.util.GenericCache
- Cache, java.io.Serializable
public abstract class GenericCache
extends java.lang.Object
implements Cache, java.io.Serializable
This is the base class for all cache implementations provided in the
org.apache.oro.util package. To derive a subclass from GenericCache
only the ... methods
need be overridden.
Although 4 subclasses of GenericCache are provided with this
package, users may not derive subclasses from this class.
Rather, users should create their own implmentations of the
Cache
interface.
static int | DEFAULT_CAPACITY - The default capacity to be used by the GenericCache subclasses
provided with this package.
|
abstract void | addElement(Object key, Object value)
|
int | capacity() - Returns the maximum number of elements that can be cached at one time.
|
Object | getElement(Object key)
|
boolean | isFull()
|
Iterator | keys()
|
int | size() - Returns the number of elements in the cache, not to be confused with
the
capacity() which returns the number
of elements that can be held in the cache at one time.
|
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITY
The default capacity to be used by the GenericCache subclasses
provided with this package. Its value is 20.
addElement
public abstract void addElement(Object key,
Object value)
- addElement in interface Cache
capacity
public final int capacity()
Returns the maximum number of elements that can be cached at one time.
- capacity in interface Cache
- The maximum number of elements that can be cached at one time.
getElement
public Object getElement(Object key)
- getElement in interface Cache
isFull
public final boolean isFull()
keys
public final Iterator keys()
size
public final int size()
Returns the number of elements in the cache, not to be confused with
the
capacity()
which returns the number
of elements that can be held in the cache at one time.
- size in interface Cache
- The current size of the cache (i.e., the number of elements
currently cached).
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.