Package org.glassfish.grizzly.attributes
Class IndexedAttributeHolder.IndexedAttributeAccessorImpl
- java.lang.Object
-
- org.glassfish.grizzly.attributes.IndexedAttributeHolder.IndexedAttributeAccessorImpl
-
- All Implemented Interfaces:
IndexedAttributeAccessor
- Enclosing class:
- IndexedAttributeHolder
protected final class IndexedAttributeHolder.IndexedAttributeAccessorImpl extends Object implements IndexedAttributeAccessor
IndexedAttributeAccessorimplementation.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIndexedAttributeAccessorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(int index)Internal method for dynamic attribute support.ObjectgetAttribute(int index, NullaryFunction initializer)Internal method for dynamic attribute support.ObjectremoveAttribute(int index)Internal method for dynamic attribute support.voidsetAttribute(int index, Object value)Internal method for dynamic attribute support.
-
-
-
Method Detail
-
getAttribute
public Object getAttribute(int index)
Internal method for dynamic attribute support. Return the value of the attribute by index.- Specified by:
getAttributein interfaceIndexedAttributeAccessor- Parameters:
index- the attribute index- Returns:
- the value of the attribute by index
-
getAttribute
public Object getAttribute(int index, NullaryFunction initializer)
Internal method for dynamic attribute support. Return the value of the attribute by index. If the attribute with such index is not set, set it to the default value, using the initializer, and return the default.- Specified by:
getAttributein interfaceIndexedAttributeAccessor- Parameters:
index- the attribute indexinitializer- the default valueNullaryFunction- Returns:
- the value of the attribute by index
-
setAttribute
public void setAttribute(int index, Object value)Internal method for dynamic attribute support. Set the attribute with the index to value.- Specified by:
setAttributein interfaceIndexedAttributeAccessor- Parameters:
index- the attribute indexvalue- the value
-
removeAttribute
public Object removeAttribute(int index)
Description copied from interface:IndexedAttributeAccessorInternal method for dynamic attribute support. Removes the attribute with the index and returns its previous value.- Specified by:
removeAttributein interfaceIndexedAttributeAccessor- Parameters:
index- the attribute index- Returns:
- the previous value associated with the attribute
-
-