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.
 java.lang.Object getAttribute(java.lang.String name)
          Return an object based on a name.
 AttributeBuilder getAttributeBuilder()
          Get AttributeBuilder, associated with this holder
 java.util.Set<java.lang.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.
 void recycle()
          Recycle AttributeHolder
 java.lang.Object removeAttribute(java.lang.String name)
          Remove a name/value object.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set a name/value object.
 

Method Detail

removeAttribute

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

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

setAttribute

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

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

getAttribute

java.lang.Object getAttribute(java.lang.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

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

Returns:
- Set of attribute names

clear

void clear()
Clear all the attributes.


recycle

void recycle()
Recycle AttributeHolder


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 © 2012 Oracle Corporation. All Rights Reserved.