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 | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| protected final DefaultAttributeBuilder | |
| private volatile int | |
| protected final IndexedAttributeAccessor | |
| private IndexedAttributeHolder. | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| public | IndexedAttributeHolder(final AttributeBuilder attributeBuilder)
Deprecated
use
AttributeBuilder#createSafeAttributeHolder()
|
| public |
| attributeBuilder | back to summary |
|---|---|
| protected final DefaultAttributeBuilder attributeBuilder | |
| count | back to summary |
|---|---|
| private volatile int count | |
| indexedAttributeAccessor | back to summary |
|---|---|
| protected final IndexedAttributeAccessor indexedAttributeAccessor | |
| state | back to summary |
|---|---|
| private IndexedAttributeHolder. | |
| sync | back to summary |
|---|---|
| private final Object sync | |
| IndexedAttributeHolder | back to summary |
|---|---|
| public IndexedAttributeHolder(final AttributeBuilder attributeBuilder)
Deprecated
| |
| IndexedAttributeHolder | back to summary |
|---|---|
| public IndexedAttributeHolder(final AttributeBuilder attributeBuilder, final int initialCapacity) | |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Doc from org. Clear all the attributes.
| |
| copyFrom | back to summary |
|---|---|
| public void copyFrom(final AttributeHolder srcAttributes) Implements org. Doc from org. Copies attributes from the srcAttributes to this AttributeHolder
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(final AttributeHolder dstAttributes) Implements org. Doc from org. Copies attributes from this AttributeHolder to the dstAttributes.
| |
| ensureSize | back to summary |
|---|---|
| private static Object[] ensureSize(final Object[] array, final int size) | |
| ensureSize | back to summary |
|---|---|
| private static int[] ensureSize(final int[] array, final int size) | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(final String name) Implements org. Doc from org. Return an object based on a name.
| |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(final String name, final Supplier<T> initializer) Implements org. Doc from org. Return an object based on a name.
| |
| getAttributeBuilder | back to summary |
|---|---|
| public AttributeBuilder getAttributeBuilder() Implements org. Doc from org. Get AttributeBuilder, associated with this holder
| |
| getAttributeNames | back to summary |
|---|---|
| public Set Implements org. Doc from org. Return a
| |
| getIndexedAttributeAccessor | back to summary |
|---|---|
| public IndexedAttributeAccessor getIndexedAttributeAccessor() Implements org. Returns
| |
| recycle | back to summary |
|---|---|
| public void recycle() Implements org. Doc from org. Recycle AttributeHolder
| |
| removeAttribute | back to summary |
|---|---|
| public Object removeAttribute(final String name) Implements org. Doc from org. Remove a name/value object.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String name, final Object value) Implements org. Doc from org. Set a name/value object.
| |
IndexedAttributeAccessor implementation.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Object | getAttribute(final int index)
Implements org. Internal method for dynamic attribute support. |
| public Object | getAttribute(final int index, final Supplier<T> initializer)
Implements org. Internal method for dynamic attribute support. |
| public Object | removeAttribute(final int index)
Implements org. Internal method for dynamic attribute support. |
| public void | setAttribute(final int index, final Object value)
Implements org. Internal method for dynamic attribute support. |
| private void | |
| private Object |
| IndexedAttributeAccessorImpl | back to summary |
|---|---|
| protected IndexedAttributeAccessorImpl() | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(final int index) Implements org. Doc from org. Internal method for dynamic attribute support. Return the value of the attribute by index.
| |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(final int index, final Supplier<T> initializer) Implements org. Doc from org. 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.
| |
| removeAttribute | back to summary |
|---|---|
| public Object removeAttribute(final int index) Implements org. Doc from org. Internal method for dynamic attribute support. Removes the attribute with the index and returns its previous value.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final int index, final Object value) Implements org. Doc from org. Internal method for dynamic attribute support. Set the attribute with the index to value.
| |
| setSync | back to summary |
|---|---|
| private void setSync(final int index, final Object value) | |
| weakGet | back to summary |
|---|---|
| private Object weakGet(final int index) | |
| Modifier and Type | Field and Description |
|---|---|
| private final int[] | |
| private final int | |
| private final Object[] |
| Access | Constructor and Description |
|---|---|
| public |
| i2v | back to summary |
|---|---|
| private final int[] i2v | |
| size | back to summary |
|---|---|
| private final int size | |
| values | back to summary |
|---|---|
| private final Object[] values | |
| Snapshot | back to summary |
|---|---|
| public Snapshot(Object[] values, int[] i2v, int size) | |