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.
|
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)
anMaxSize
- the maximum size of the cache.public static int getDefaultMaxSize(java.lang.String astrConfigName, int aDefaultMaxSize)
astrConfigName
- a unique identifier used to lookup the configured default maximum size.
Normally, this is the class name of the caching class.aDefaultMaxSize
- the default maximum size to use if none is configured.public void clear()
public java.lang.Object remove(java.lang.Object aKey) throws ECException
aKey
- the key.ECException
public java.lang.Object get(java.lang.Object aKey) throws ECException
aKey
- the key.ECException
public int getMaxSize()
public void setMaxSize(int anMaxSize)
anMaxSize
- the maximum size of the cache.public void setSize(int anMaxSize)
setMaxSize(int)
.anMaxSize
- the maximum size of the cache.public java.lang.String toString()
toString
in class java.lang.Object