public final 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.
This implementation is thread-safe.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)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all the attributes.
|
void |
copyFrom(AttributeHolder srcAttributes)
Copies attributes from the srcAttributes to this AttributeHolder
|
void |
copyTo(AttributeHolder dstAttributes)
Copies attributes from this AttributeHolder to the dstAttributes.
|
Object |
getAttribute(String name)
Return an object based on a name.
|
Object |
getAttribute(String name,
NullaryFunction initializer)
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. |
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)
AttributeBuilder.createSafeAttributeHolder()attributeBuilder - public Object getAttribute(String name)
getAttribute in interface AttributeHoldername - - name of an attributepublic Object getAttribute(String name, NullaryFunction initializer)
getAttribute in interface AttributeHoldername - - name of an attributeinitializer - the initializer to be used to assign a default attribute value,
in case it hasn't been assignedpublic void setAttribute(String name, Object value)
setAttribute in interface AttributeHoldername - - name of an attributevalue - - value of named attributepublic Object removeAttribute(String name)
removeAttribute in interface AttributeHoldername - - name of an attributepublic Set<String> getAttributeNames()
Set of attribute names.getAttributeNames in interface AttributeHolderSet of attribute namespublic void copyFrom(AttributeHolder srcAttributes)
AttributeHoldercopyFrom in interface AttributeHolderpublic void copyTo(AttributeHolder dstAttributes)
AttributeHoldercopyTo in interface AttributeHolderpublic void recycle()
recycle in interface AttributeHolderpublic void clear()
clear in interface AttributeHolderpublic AttributeBuilder getAttributeBuilder()
getAttributeBuilder in interface AttributeHolderpublic IndexedAttributeAccessor getIndexedAttributeAccessor()
IndexedAttributeAccessor for accessing Attributes
by index.getIndexedAttributeAccessor in interface AttributeHolderIndexedAttributeAccessor for accessing Attributes
by index.Copyright © 2015 Oracle Corporation. All Rights Reserved.