|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.persist.LRU
org.exolab.castor.persist.LRU.CountLimited
CountLimited is a count limted least-recently-used Map.
Every object being put in the Map will live until the map is full. If the map is full, a least-recently-used object will be disposed.
Method dispose(Object) will be called whenever an
old object is diposed. Developer can get notify by overriding
the dispose method dispose(Object).
| Nested Class Summary |
|---|
| Nested classes inherited from class org.exolab.castor.persist.LRU |
|---|
LRU.CountLimited, LRU.NoCache, LRU.TimeLimited, LRU.Unlimited |
| Field Summary |
|---|
| Fields inherited from class org.exolab.castor.persist.LRU |
|---|
CACHE_COUNT_LIMITED, CACHE_NONE, CACHE_TIME_LIMITED, CACHE_UNLIMITED, DEFAULT_PARAM, DEFAULT_TYPE |
| Constructor Summary | |
|---|---|
LRU.CountLimited(int size)
|
|
| Method Summary | |
|---|---|
protected void |
dispose(java.lang.Object o)
This method is called when an object is disposed. |
java.util.Enumeration |
elements()
Returns an enumeration of the values in this LRU map. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which the specified key is mapped in this Map. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object object)
Maps the specified key to the specified
value in this Map. |
java.lang.Object |
remove(java.lang.Object key)
Removes the key (and its corresponding value) from this Map. |
| Methods inherited from class org.exolab.castor.persist.LRU |
|---|
create, mapType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LRU.CountLimited(int size)
| Method Detail |
public java.lang.Object put(java.lang.Object key,
java.lang.Object object)
key to the specified
value in this Map. 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
when the Map is full.
put in class LRUkey - the Map key.object - the value.
null if it did not have one.
java.lang.NullPointerException - if the key or value is
null.public java.lang.Object get(java.lang.Object key)
get in class LRUkey - - a key in the Map.
public java.lang.Object remove(java.lang.Object key)
remove in class LRUkey - the key that needs to be removed.
null if the key did not have a mapping.public java.util.Enumeration elements()
elements in class LRUEnumerationprotected void dispose(java.lang.Object o)
o - - the disposed object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||