Package de.intarsys.tools.attribute
Class AttributeMap
- java.lang.Object
-
- de.intarsys.tools.attribute.AttributeMap
-
- All Implemented Interfaces:
IAttributeSupport
public final class AttributeMap extends java.lang.Object implements IAttributeSupport
A default implementation forIAttributeSupport
. The API is "doubled" to be usable as a simple replacement for aMap
.The keys are looked up using object identity!
-
-
Constructor Summary
Constructors Constructor Description AttributeMap()
AttributeMap(int initialCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
java.lang.Object
get(java.lang.Object key)
java.lang.Object
getAttribute(java.lang.Object key)
Get an attribute value from the contextjava.lang.Object[]
getKeys()
The keys used in this attribute lookup map.java.lang.Object
put(java.lang.Object key, java.lang.Object o)
java.lang.Object
remove(java.lang.Object key)
java.lang.Object
removeAttribute(java.lang.Object key)
Remove an attribute binding in the contextjava.lang.Object
setAttribute(java.lang.Object key, java.lang.Object value)
Set the value of an attribute in the context
-
-
-
Method Detail
-
clear
public void clear()
-
get
public java.lang.Object get(java.lang.Object key)
-
getAttribute
public java.lang.Object getAttribute(java.lang.Object key)
Description copied from interface:IAttributeSupport
Get an attribute value from the context- Specified by:
getAttribute
in interfaceIAttributeSupport
- Parameters:
key
- the name of the attribute to get- Returns:
- The value of the attribute
key
-
getKeys
public java.lang.Object[] getKeys()
The keys used in this attribute lookup map.!! This is not intended to be published to client code, as this would compromise IAttributeSupport security !!
- Returns:
- The keys used in this attribute lookup map.
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object o)
-
remove
public java.lang.Object remove(java.lang.Object key)
-
removeAttribute
public java.lang.Object removeAttribute(java.lang.Object key)
Description copied from interface:IAttributeSupport
Remove an attribute binding in the context- Specified by:
removeAttribute
in interfaceIAttributeSupport
- Parameters:
key
- the name of the attribute to remove- Returns:
- The previously associated value for
key
-
setAttribute
public java.lang.Object setAttribute(java.lang.Object key, java.lang.Object value)
Description copied from interface:IAttributeSupport
Set the value of an attribute in the context- Specified by:
setAttribute
in interfaceIAttributeSupport
- Parameters:
key
- the name of the attribute to setvalue
- the new value the attribute- Returns:
- The previously associated value for
key
-
-