org.apache.tapestry.util
Class ObjectIdentityMap
java.lang.Object
org.apache.tapestry.util.ObjectIdentityMap
public class ObjectIdentityMap
- extends java.lang.Object
A simple map-like collection, similar to (but more more limited than) JDK 1.4's IdentityHashMap.
It is designed for small collections of objects.
- Since:
- 4.0
- Author:
- Howard Lewis Ship
Method Summary |
java.lang.Object |
get(java.lang.Object key)
Returns the object stored for the given key. |
void |
put(java.lang.Object key,
java.lang.Object value)
Adds or updates a key in the bag. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectIdentityMap
public ObjectIdentityMap()
put
public void put(java.lang.Object key,
java.lang.Object value)
- Adds or updates a key in the bag.
- Parameters:
key
- the key to store a value under; an existing value with the key is discardedvalue
- the value to store
get
public java.lang.Object get(java.lang.Object key)
- Returns the object stored for the given key.
- Returns:
- the value, or null if the key is not found