AttributeHolder instances. Storing attribute values in
AttributeHolder has two advantage comparing to Map storage: 1) Attribute value is typed, and could
be checked at compile time. 2) Access to Attribute value, if used with IndexedAttributeHolder, could
be as fast as access to array.
| Modifier and Type | Field and Description |
|---|---|
| private final int | attributeIndex
Attribute index in AttributeBuilder |
| private final AttributeBuilder | builder
AttributeBuilder, which was used to create this attribute |
| private final Supplier | initializer
Attribute initializer, which will be called, if attribute is not set. |
| private final String | name
Attribute name |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | Attribute(final AttributeBuilder builder, final String name, final int index, final Supplier<T> initializer)
|
| Modifier and Type | Method and Description |
|---|---|
| public T | Returns: attribute valueGet attribute value, stored on the |
| public T | Returns: attribute valueGet attribute value, stored on the |
| private T | |
| public int | Returns: attribute indexed.Return attribute name, which is used as attribute key on indexed |
| public boolean | Returns: true, if attribute is set, of false otherwise.Checks if this attribute is set on the |
| public boolean | Returns: true, if attribute is set, of false otherwise.Checks if this attribute is set on the |
| public String | Returns: attribute name.Return attribute name, which is used as attribute key on non-indexed |
| public T | Returns: attribute valueGet attribute value, stored on the |
| public T | Returns: attribute valueGet attribute value, stored on the |
| public T | Returns: the previous value associated with the attributeRemove attribute value, stored on the |
| public T | |
| public void | set(final AttributeHolder attributeHolder, final T
attribute value to set. value)Set attribute value, stored on the |
| public void | set(final AttributeStorage storage, final T
attribute value to set. value)Set attribute value, stored on the |
| public String |
| attributeIndex | back to summary |
|---|---|
| private final int attributeIndex Attribute index in AttributeBuilder | |
| builder | back to summary |
|---|---|
| private final AttributeBuilder builder AttributeBuilder, which was used to create this attribute | |
| initializer | back to summary |
|---|---|
| private final Supplier<T> initializer Attribute initializer, which will be called, if attribute is not set. | |
| name | back to summary |
|---|---|
| private final String name Attribute name | |
| Attribute | back to summary |
|---|---|
| protected Attribute(final AttributeBuilder builder, final String name, final int index, final T defaultValue) | |
| Attribute | back to summary |
|---|---|
| protected Attribute(final AttributeBuilder builder, final String name, final int index, final Supplier<T> initializer) | |
| get | back to summary |
|---|---|
| public T get(final AttributeHolder attributeHolder) Get attribute value, stored on the
| |
| get | back to summary |
|---|---|
| public T get(final AttributeStorage storage) Get attribute value, stored on the
| |
| get0 | back to summary |
|---|---|
private T get0(final AttributeHolder attributeHolder, final Supplier<T> initializer)
| |
| index | back to summary |
|---|---|
| public int index() Return attribute name, which is used as attribute key on indexed
| |
| isSet | back to summary |
|---|---|
| public boolean isSet(final AttributeHolder attributeHolder) Checks if this attribute is set on the
| |
| isSet | back to summary |
|---|---|
| public boolean isSet(final AttributeStorage storage) Checks if this attribute is set on the
| |
| name | back to summary |
|---|---|
| public String name() Return attribute name, which is used as attribute key on non-indexed
| |
| peek | back to summary |
|---|---|
| public T peek(final AttributeHolder attributeHolder) Get attribute value, stored on the
| |
| peek | back to summary |
|---|---|
| public T peek(final AttributeStorage storage) Get attribute value, stored on the
| |
| remove | back to summary |
|---|---|
| public T remove(final AttributeHolder attributeHolder) Remove attribute value, stored on the
| |
| remove | back to summary |
|---|---|
| public T remove(final AttributeStorage storage) Remove attribute value, stored on the
| |
| set | back to summary |
|---|---|
| public void set(final AttributeHolder attributeHolder, final T value) Set attribute value, stored on the
| |
| set | back to summary |
|---|---|
| public void set(final AttributeStorage storage, final T value) Set attribute value, stored on the
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |