com.sun.grizzly.attributes
Class NamedAttributeHolder

java.lang.Object
  extended by com.sun.grizzly.attributes.NamedAttributeHolder
All Implemented Interfaces:
AttributeHolder

public class NamedAttributeHolder
extends Object
implements AttributeHolder

AttributeHolder implementation, which doesn't support indexed access to Attributes.

Author:
Alexey Stashok
See Also:
AttributeHolder, IndexedAttributeHolder

Field Summary
protected  DefaultAttributeBuilder attributeBuilder
           
protected  Map<String,Object> attributesMap
           
 
Constructor Summary
NamedAttributeHolder(AttributeBuilder attributeBuilder)
           
 
Method Summary
 void clear()
          Clear all the attributes.
 Object getAttribute(String name)
          Return an object based on a name.
 AttributeBuilder getAttributeBuilder()
          Get AttributeBuilder, associated with this holder
 Set<String> getAttributeNames()
          Return a Set of attribute names.
 IndexedAttributeAccessor getIndexedAttributeAccessor()
          Always returns null, as NamedAttributeHolder doesn't support indexing.
 Object removeAttribute(String name)
          Remove a name/value object.
 void setAttribute(String name, Object value)
          Set a name/value object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributesMap

protected Map<String,Object> attributesMap

attributeBuilder

protected DefaultAttributeBuilder attributeBuilder
Constructor Detail

NamedAttributeHolder

public NamedAttributeHolder(AttributeBuilder attributeBuilder)
Method Detail

getAttribute

public Object getAttribute(String name)
Return an object based on a name.

Specified by:
getAttribute in interface AttributeHolder
Parameters:
name - - name of an attribute
Returns:
- attribute value for the name, null if name does not exist in attributes

setAttribute

public void setAttribute(String name,
                         Object value)
Set a name/value object.

Specified by:
setAttribute in interface AttributeHolder
Parameters:
name - - name of an attribute
value - - value of named attribute

removeAttribute

public Object removeAttribute(String name)
Remove a name/value object.

Specified by:
removeAttribute in interface AttributeHolder
Parameters:
name - - name of an attribute
Returns:
attribute which has been removed

getAttributeNames

public Set<String> getAttributeNames()
Return a Set of attribute names.

Specified by:
getAttributeNames in interface AttributeHolder
Returns:
- Set of attribute names

clear

public void clear()
Clear all the attributes.

Specified by:
clear in interface AttributeHolder

getAttributeBuilder

public AttributeBuilder getAttributeBuilder()
Get AttributeBuilder, associated with this holder

Specified by:
getAttributeBuilder in interface AttributeHolder
Returns:
AttributeBuilder

getIndexedAttributeAccessor

public IndexedAttributeAccessor getIndexedAttributeAccessor()
Always returns null, as NamedAttributeHolder doesn't support indexing.

Specified by:
getIndexedAttributeAccessor in interface AttributeHolder
Returns:
null


Copyright © 2009 SUN Microsystems. All Rights Reserved.