org.exolab.castor.persist

Class LRU.NoCache

public static class LRU.NoCache extends LRU

NoCache is a Map which dispose all object right the way.

Every object being put in the Map will be disposed.

Method dispose will be called whenever an old object is diposed. Developer can get notify by overriding the dispose method dispose.

Author: Thomas Yip

Method Summary
protected voiddispose(Object o)
This method is called when an object is disposed.
Enumerationelements()
Returns an enumeration of the values in this LRU map.
Objectget(Object key)
Returns the value to which the specified key is mapped in this Map.
Objectput(Object key, Object object)
Maps the specified key to the specified value in this Map.
Objectremove(Object key)
Removes the key (and its corresponding value) from this Map.

Method Detail

dispose

protected void dispose(Object o)
This method is called when an object is disposed. Override this method if you interested in the disposed object.

elements

public Enumeration elements()
Returns an enumeration of the values in this LRU map. Use the Enumeration methods on the returned object to fetch the elements sequentially.

Returns: an enumeration of the values in this Map.

See Also: java.util.Enumeration

get

public Object get(Object key)
Returns the value to which the specified key is mapped in this Map.

Parameters: key - a key in the Map.

Returns: the value to which the key is mapped in this Map; null if the key is not mapped to any value in this Map.

put

public Object put(Object key, Object object)
Maps the specified key to the specified value in this Map. Neither the key nor the value can be null. End of theory.

Every object being put in the Map will be disposed.

Parameters: key the Map key. value the value.

Returns: the previous value of the specified key in this Map, or null if it did not have one.

Throws: NullPointerException if the key or value is null.

remove

public Object remove(Object key)
Removes the key (and its corresponding value) from this Map. This method does nothing if the key is not in the Map.

Parameters: key the key that needs to be removed.

Returns: the value to which the key had been mapped in this Map, or null if the key did not have a mapping.

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com