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.
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.
use
AttributeBuilder#createAttributeHolder() |
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.
|
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)
AttributeBuilder#createAttributeHolder()
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 copyFrom(AttributeHolder srcAttributes)
AttributeHolder
copyFrom
in interface AttributeHolder
public void copyTo(AttributeHolder dstAttributes)
AttributeHolder
copyTo
in interface AttributeHolder
public 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 © 2012-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.