Class AttributeMap

java.lang.Object
de.intarsys.tools.attribute.AttributeMap
All Implemented Interfaces:
IAttributeSupport

public final class AttributeMap extends Object implements IAttributeSupport
A default implementation for IAttributeSupport. The API is "doubled" to be usable as a simple replacement for a Map.

The keys are looked up using object identity!

  • Constructor Details

    • AttributeMap

      public AttributeMap()
    • AttributeMap

      public AttributeMap(int initialCapacity)
  • Method Details

    • clear

      public void clear()
    • get

      public Object get(Object key)
    • getAttribute

      public Object getAttribute(Object key)
      Description copied from interface: IAttributeSupport
      Get an attribute value from the context
      Specified by:
      getAttribute in interface IAttributeSupport
      Parameters:
      key - the name of the attribute to get
      Returns:
      The value of the attribute key
    • getKeys

      public 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 Object put(Object key, Object o)
    • remove

      public Object remove(Object key)
    • removeAttribute

      public Object removeAttribute(Object key)
      Description copied from interface: IAttributeSupport
      Remove an attribute binding in the context
      Specified by:
      removeAttribute in interface IAttributeSupport
      Parameters:
      key - the name of the attribute to remove
      Returns:
      The previously associated value for key
    • setAttribute

      public Object setAttribute(Object key, Object value)
      Description copied from interface: IAttributeSupport
      Set the value of an attribute in the context
      Specified by:
      setAttribute in interface IAttributeSupport
      Parameters:
      key - the name of the attribute to set
      value - the new value the attribute
      Returns:
      The previously associated value for key