com.sun.grizzly.attributes
Class IndexedAttributeHolder

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

public class IndexedAttributeHolder
extends Object
implements AttributeHolder

AttributeHolder, which supports indexed access to stored Attributes. Access to such indexed Attributes could be as fast as access to array.

Author:
Alexey Stashok
See Also:
AttributeHolder, NamedAttributeHolder

Nested Class Summary
protected  class IndexedAttributeHolder.IndexedAttributeAccessorImpl
          IndexedAttributeAccessor implementation.
 
Field Summary
protected  DefaultAttributeBuilder attributeBuilder
           
protected  LightArrayList<Object> attributeValues
           
protected  IndexedAttributeAccessor indexedAttributeAccessor
           
 
Constructor Summary
IndexedAttributeHolder(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()
          Returns IndexedAttributeAccessor for accessing Attributes by index.
 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

attributeValues

protected LightArrayList<Object> attributeValues

attributeBuilder

protected DefaultAttributeBuilder attributeBuilder

indexedAttributeAccessor

protected IndexedAttributeAccessor indexedAttributeAccessor
Constructor Detail

IndexedAttributeHolder

public IndexedAttributeHolder(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()
Returns IndexedAttributeAccessor for accessing Attributes by index.

Specified by:
getIndexedAttributeAccessor in interface AttributeHolder
Returns:
IndexedAttributeAccessor for accessing Attributes by index.


Copyright © 2009 SUN Microsystems. All Rights Reserved.