public abstract class Cache
extends java.lang.Object
LRUcaches classes.
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
The IBM copyright notice fields.
|
static int | DEFAULT_MAX_SIZE
The default maximum cache size.
|
Constructor and Description |
---|
Cache()
Constructor for Cache, with a maximum size that defaults to
|
Cache(int anMaxSize)
Constructor for Cache.
|
Modifier and Type | Method and Description |
---|---|
void | clear()
Clears the cache.
|
java.lang.Object | get(java.lang.Object aKey)
Returns the value which the key is mapped to.
|
static int | getDefaultMaxSize(java.lang.String astrConfigName, int aDefaultMaxSize)
Returns the configured default maximum size.
|
int | getMaxSize()
Returns the maximum size of the cache.
|
protected int | getSize(java.lang.Object aValue)
Returns the size of a value.
|
protected abstract java.lang.Object | miss(java.lang.Object aKey)
Returns the value a key is mapped to.
|
java.lang.Object | remove(java.lang.Object aKey)
Removes the value which the key is mapped to.
|
void | setMaxSize(int anMaxSize)
Sets the maximum size of the cache.
|
void | setSize(int anMaxSize)
Deprecated.
renamed to setMaxSize(int).
|
java.lang.String | toString()
Returns the string representation of the cache for diagnostic purposes.
|
public static final java.lang.String COPYRIGHT
public static final int DEFAULT_MAX_SIZE
public Cache()
DEFAULT_MAX_SIZE.
public Cache(int anMaxSize)
public static int getDefaultMaxSize(java.lang.String astrConfigName, int aDefaultMaxSize)
public void clear()
public java.lang.Object remove(java.lang.Object aKey) throws ECException
public java.lang.Object get(java.lang.Object aKey) throws ECException
protected int getSize(java.lang.Object aValue)
protected abstract java.lang.Object miss(java.lang.Object aKey) throws ECException
public int getMaxSize()
public void setMaxSize(int anMaxSize)
public void setSize(int anMaxSize)
public java.lang.String toString()