public final class IndexedAttributeHolder extends Object implements AttributeHolder
AttributeHolder
, which supports indexed access to stored
Attribute
s. Access to such indexed Attribute
s could be as
fast as access to array.AttributeHolder
,
NamedAttributeHolder
Modifier and Type | Class and Description |
---|---|
protected class |
IndexedAttributeHolder.IndexedAttributeAccessorImpl
IndexedAttributeAccessor implementation. |
Modifier and Type | Field and Description |
---|---|
protected DefaultAttributeBuilder |
attributeBuilder |
protected IndexedAttributeAccessor |
indexedAttributeAccessor |
Constructor and Description |
---|
IndexedAttributeHolder(AttributeBuilder attributeBuilder) |
Modifier and Type | Method and Description |
---|---|
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 Attribute s
by index. |
void |
recycle()
Recycle AttributeHolder
|
Object |
removeAttribute(String name)
Remove a name/value object.
|
void |
setAttribute(String name,
Object value)
Set a name/value object.
|
protected final DefaultAttributeBuilder attributeBuilder
protected final IndexedAttributeAccessor indexedAttributeAccessor
public IndexedAttributeHolder(AttributeBuilder attributeBuilder)
public Object getAttribute(String name)
getAttribute
in interface AttributeHolder
name
- - name of an attributepublic void setAttribute(String name, Object value)
setAttribute
in interface AttributeHolder
name
- - name of an attributevalue
- - value of named attributepublic Object removeAttribute(String name)
removeAttribute
in interface AttributeHolder
name
- - name of an attributepublic Set<String> getAttributeNames()
Set
of attribute names.getAttributeNames
in interface AttributeHolder
Set
of attribute namespublic void recycle()
recycle
in interface AttributeHolder
public void clear()
clear
in interface AttributeHolder
public AttributeBuilder getAttributeBuilder()
getAttributeBuilder
in interface AttributeHolder
public IndexedAttributeAccessor getIndexedAttributeAccessor()
IndexedAttributeAccessor
for accessing Attribute
s
by index.getIndexedAttributeAccessor
in interface AttributeHolder
IndexedAttributeAccessor
for accessing Attribute
s
by index.Copyright © 2014 Oracle Corporation. All rights reserved.