intarsys runtime library

de.intarsys.tools.attribute
Class AttributeMap

java.lang.Object
  extended by 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 Summary
AttributeMap()
           
AttributeMap(int initialCapacity)
           
 
Method Summary
 void clear()
           
 Object get(Object key)
           
 Object getAttribute(Object key)
          get an attribute from the context
 Object[] getKeys()
          The keys used in this attribute lookup map.
 Object put(Object key, Object o)
           
 Object remove(Object key)
           
 Object removeAttribute(Object key)
          remove an attribute in the context
 Object setAttribute(Object key, Object value)
          set the value of an attribute in the context
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeMap

public AttributeMap()

AttributeMap

public AttributeMap(int initialCapacity)
Method Detail

clear

public void clear()

get

public Object get(Object key)

getAttribute

public Object getAttribute(Object key)
Description copied from interface: IAttributeSupport
get an attribute from the context

Specified by:
getAttribute in interface IAttributeSupport
Parameters:
key - the name of the attribute to get
Returns:
The value of the attribute to get

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 in the context

Specified by:
removeAttribute in interface IAttributeSupport
Parameters:
key - the name of the attribute to remove
Returns:
The previously associated object 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 object for key

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.