org.glassfish.grizzly.attributes
Interface AttributeHolder

All Known Implementing Classes:
IndexedAttributeHolder, NamedAttributeHolder

public interface AttributeHolder

Interface declares common functionality for objects, which have associated Attributes.

Author:
Alexey Stashok
See Also:
IndexedAttributeHolder, NamedAttributeHolder

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()
          If AttributeHolder supports attribute access by index - it will return an IndexedAttributeAccessor, which will make Attribute access as fast as access to array element.
 Object removeAttribute(String name)
          Remove a name/value object.
 void setAttribute(String name, Object value)
          Set a name/value object.
 

Method Detail

removeAttribute

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

Parameters:
name - - name of an attribute
Returns:
attribute which has been removed

setAttribute

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

Parameters:
name - - name of an attribute
value - - value of named attribute

getAttribute

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

Parameters:
name - - name of an attribute
Returns:
- attribute value for the name, null if name does not exist in attributes

getAttributeNames

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

Returns:
- Set of attribute names

clear

void clear()
Clear all the attributes.


getAttributeBuilder

AttributeBuilder getAttributeBuilder()
Get AttributeBuilder, associated with this holder

Returns:
AttributeBuilder

getIndexedAttributeAccessor

IndexedAttributeAccessor getIndexedAttributeAccessor()
If AttributeHolder supports attribute access by index - it will return an IndexedAttributeAccessor, which will make Attribute access as fast as access to array element.

Returns:
IndexedAttributeAccessor.


Copyright © 2009 SUN Microsystems. All Rights Reserved.