|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.persist.LRU
Base interface for all least-recently-used cache.
| Nested Class Summary | |
|---|---|
static class |
LRU.CountLimited
CountLimited is a count limted least-recently-used Map. |
static class |
LRU.NoCache
NoCache is a Map which dispose all object right the way. |
static class |
LRU.TimeLimited
TimeLimited is a time limted least-recently-used Map. |
static class |
LRU.Unlimited
UnLimited is Map which implements the LRU interface. |
| Field Summary | |
|---|---|
static int |
CACHE_COUNT_LIMITED
Map type of Count-Limited least-recently-used as caching mechanism. |
static int |
CACHE_NONE
Map type for no caching as the caching mechanism. |
static int |
CACHE_TIME_LIMITED
Map type of Time-Limited least-recently-used is used as caching mechanism. |
static int |
CACHE_UNLIMITED
Map type of unlimited cache as caching mechanism. |
static int |
DEFAULT_PARAM
Specify the default LRU parameter |
static int |
DEFAULT_TYPE
Specify the default LRU mechanism |
| Constructor Summary | |
|---|---|
LRU()
|
|
| Method Summary | |
|---|---|
static LRU |
create(int type,
int param)
Factory method to create a LRU map of specified type. |
abstract java.util.Enumeration |
elements()
Returns an enumeration of the values in this LRU map. |
abstract java.lang.Object |
get(java.lang.Object key)
Returns the value to which the specified key is mapped in this hashtable. |
static int |
mapType(java.lang.String type)
Map the type in String into an int to represent the lru cache type. |
abstract java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Maps the specified key to the specified
value in this hashtable. |
abstract java.lang.Object |
remove(java.lang.Object key)
Removes the key (and its corresponding value) from this hashtable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int CACHE_NONE
public static final int CACHE_COUNT_LIMITED
public static final int CACHE_TIME_LIMITED
public static final int CACHE_UNLIMITED
public static final int DEFAULT_TYPE
public static final int DEFAULT_PARAM
| Constructor Detail |
public LRU()
| Method Detail |
public abstract java.lang.Object put(java.lang.Object key,
java.lang.Object value)
key to the specified
value in this hashtable. Neither the key nor the
value can be null.
The value can be retrieved by calling the get method
with a key that is equal to the original key, before it is diposed
by the least-recently-used map.
key - the hashtable key.value - the value.
null if it did not have one.
java.lang.NullPointerException - if the key or value is
null.public abstract java.lang.Object get(java.lang.Object key)
key - - a key in the hashtable.
public abstract java.lang.Object remove(java.lang.Object key)
key - the key that needs to be removed.
null if the key did not have a mapping.public abstract java.util.Enumeration elements()
Enumeration
public static LRU create(int type,
int param)
type - mechanism typeparam - capacity of the lrupublic static int mapType(java.lang.String type)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||