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 voidclear()java.lang.Objectget(java.lang.Object key)java.lang.ObjectgetAttribute(java.lang.Object key)Get an attribute value from the contextjava.lang.Object[]getKeys()The keys used in this attribute lookup map.java.lang.Objectput(java.lang.Object key, java.lang.Object o)java.lang.Objectremove(java.lang.Object key)java.lang.ObjectremoveAttribute(java.lang.Object key)Remove an attribute binding in the contextjava.lang.ObjectsetAttribute(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:IAttributeSupportGet an attribute value from the context- Specified by:
getAttributein 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:IAttributeSupportRemove an attribute binding in the context- Specified by:
removeAttributein 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:IAttributeSupportSet the value of an attribute in the context- Specified by:
setAttributein interfaceIAttributeSupport- Parameters:
key- the name of the attribute to setvalue- the new value the attribute- Returns:
- The previously associated value for
key
-
-