public class DefaultAttributeContainer extends java.lang.Object implements AttributeContainer
AttributeContainer.AttributeEvent. Attribute updates will trigger these events using
AttributeListener.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultAttributeContainer.Builder
Chaining builder for DefaultAttributeContainer.
|
| Constructor and Description |
|---|
DefaultAttributeContainer()
Creates a new instance of DefaultAttributeContainer with no delegate container (self).
|
DefaultAttributeContainer(AttributeContainer delegateContainer)
Creates a new instance of DefaultAttributeContainer with a delegate container.
|
| Modifier and Type | Method and Description |
|---|---|
<T> boolean |
addAttributeListener(NamedAttributeType<T> namedType,
AttributeListener<T> listener)
Adds an attribute listener for the supplied named attribute type.
|
boolean |
equals(java.lang.Object obj) |
<T> void |
fireAttributeChanged(NamedAttributeType<T> namedType)
Manually fires an attribute change for the supplied attribute type.
|
<T> T |
getAttribute(NamedAttributeType<T> namedType)
Gets the attribute matching the supplied type.
|
int |
getAttributeCount()
Gets the number of total attributes within the container.
|
<T> java.util.Set<? extends AttributeListener<T>> |
getAttributeListeners(NamedAttributeType<T> namedType)
Gets all attribute listeners associated to the supplied named attribute type.
|
java.util.Set<NamedAttributeType<?>> |
getAttributeListenerTypes()
Gets all of the named attribute types with listeners bound.
|
java.util.Set<NamedAttributeType<?>> |
getAttributeTypes()
Gets all of the named attribute types with attributes.
|
AttributeContainer |
getDelegateContainer()
Gets the delegate container.
|
int |
hashCode() |
<T> T |
removeAttribute(NamedAttributeType<T> namedType)
Removes the attribute matching the supplied type.
|
<T> boolean |
removeAttributeListener(NamedAttributeType<T> namedType,
AttributeListener<T> listener)
Removes an attribute listener assigned to the supplied attribute type.
|
void |
removeAttributeListeners()
Removes all listeners.
|
<T> void |
removeAttributeListeners(NamedAttributeType<T> namedType)
Removes all listeners for the supplied attribute types.
|
void |
removeAttributes()
Removes all attributes within the container (firing removal events).
|
<T> T |
setAttribute(NamedAttributeType<T> namedType,
T attr)
Adds the supplied attribute to the collection.
|
java.util.stream.Stream<?> |
streamAttributes()
Streams all of the attributes within the container.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, addAllAttributeListeners, addAllAttributes, addAttributeListener, fireAttributeChanged, getAttribute, getAttributeListenerNames, getAttributeListeners, getAttributeListenerTypes, getAttributeNames, getAttributes, getAttributeTypes, getOptAttribute, getOptAttribute, hasAttribute, hasAttribute, hasAttributeListener, hasAttributeListener, hasAttributeListeners, hasAttributeListeners, hasAttributes, removeAttribute, removeAttributeListener, removeAttributeListeners, removeOptAttribute, removeOptAttribute, setAttribute, setOptAttribute, setOptAttributepublic DefaultAttributeContainer()
public DefaultAttributeContainer(AttributeContainer delegateContainer)
delegateContainer - Delegate AttributeContainer for events.public <T> boolean addAttributeListener(NamedAttributeType<T> namedType, AttributeListener<T> listener)
AttributeContaineraddAttributeListener in interface AttributeContainernamedType - Named attribute type.listener - Listener to add.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic <T> void fireAttributeChanged(NamedAttributeType<T> namedType)
AttributeContainerfireAttributeChanged in interface AttributeContainernamedType - Named attribute type name.public <T> T getAttribute(NamedAttributeType<T> namedType)
AttributeContainergetAttribute in interface AttributeContainernamedType - Named attribute type to check for.public int getAttributeCount()
AttributeContainergetAttributeCount in interface AttributeContainerpublic <T> java.util.Set<? extends AttributeListener<T>> getAttributeListeners(NamedAttributeType<T> namedType)
AttributeContainergetAttributeListeners in interface AttributeContainernamedType - Named attribute type to check for.public java.util.Set<NamedAttributeType<?>> getAttributeListenerTypes()
AttributeContainergetAttributeListenerTypes in interface AttributeContainerpublic java.util.Set<NamedAttributeType<?>> getAttributeTypes()
AttributeContainergetAttributeTypes in interface AttributeContainerpublic AttributeContainer getDelegateContainer()
public int hashCode()
hashCode in class java.lang.Objectpublic <T> T removeAttribute(NamedAttributeType<T> namedType)
AttributeContainerremoveAttribute in interface AttributeContainernamedType - Named attribute type to remove.public <T> boolean removeAttributeListener(NamedAttributeType<T> namedType, AttributeListener<T> listener)
AttributeContainerremoveAttributeListener in interface AttributeContainernamedType - Named attribute type.listener - Listener to remove.public void removeAttributeListeners()
AttributeContainerremoveAttributeListeners in interface AttributeContainerpublic <T> void removeAttributeListeners(NamedAttributeType<T> namedType)
AttributeContainerremoveAttributeListeners in interface AttributeContainernamedType - Named attribute type.public void removeAttributes()
AttributeContainerremoveAttributes in interface AttributeContainerpublic <T> T setAttribute(NamedAttributeType<T> namedType, T attr)
AttributeContainersetAttribute in interface AttributeContainernamedType - Named attribute type.attr - Attribute to add.public java.util.stream.Stream<?> streamAttributes()
AttributeContainerstreamAttributes in interface AttributeContainerpublic java.lang.String toString()
toString in class java.lang.Object