Package org.arakhne.afc.attrs.collection
Class AbstractAttributeCollection
- java.lang.Object
-
- org.arakhne.afc.attrs.collection.AbstractAttributeProvider
-
- org.arakhne.afc.attrs.collection.AbstractAttributeCollection
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Attribute>,AttributeCollection,AttributeProvider,JsonableObject
- Direct Known Subclasses:
BufferedAttributeCollection,HeapAttributeCollection
public abstract class AbstractAttributeCollection extends AbstractAttributeProvider implements AttributeCollection
This class implements an abstract object with attributes.- Version:
- 17.0 2020-01-04 14:41:51
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- attributes
-
-
Constructor Summary
Constructors Constructor Description AbstractAttributeCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttributeChangeListener(AttributeChangeListener listener)Add a listener on the attribute value changes.AttributeCollectionclone()Make a deep copy of this object and replies the copy.protected voidfireAttributeAddedEvent(String name, AttributeValue attr)Fire the addition event.protected voidfireAttributeChangedEvent(String name, AttributeValue oldValue, AttributeValue currentValue)Fire the attribute change event.protected voidfireAttributeClearedEvent()Fire the all attribute removal event.protected voidfireAttributeRemovedEvent(String name, AttributeValue oldValue)Fire the an attribute removal event.protected voidfireAttributeRenamedEvent(String oldName, String newName, AttributeValue attr)Fire the renaming event.booleanisEventFirable()Replies if the events are fired by this container.voidremoveAttributeChangeListener(AttributeChangeListener listener)Remove a listener on the attribute value changes.booleanrenameAttribute(String oldname, String newname)Rename the attribute.voidsetEventFirable(boolean isFirable)Set if the events are fired by this container.-
Methods inherited from class org.arakhne.afc.attrs.collection.AbstractAttributeProvider
attributes, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, iterator, protectNull, toJson, toString, unprotectNull
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeCollection
addAttributes, addAttributes, flush, removeAllAttributes, removeAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeProvider
attributes, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCount, getAttributeObject, hasAttribute, toMap, toMap
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
-
-
-
Method Detail
-
isEventFirable
@Pure public boolean isEventFirable()
Description copied from interface:AttributeCollectionReplies if the events are fired by this container.- Specified by:
isEventFirablein interfaceAttributeCollection- Returns:
trueif the events are fired; otherwisefalseif events are not fired.
-
setEventFirable
public void setEventFirable(boolean isFirable)
Description copied from interface:AttributeCollectionSet if the events are fired by this container.- Specified by:
setEventFirablein interfaceAttributeCollection- Parameters:
isFirable- istrueif the events are fired; otherwisefalseif events are not fired.
-
clone
@Pure public AttributeCollection clone()
Make a deep copy of this object and replies the copy.- Specified by:
clonein interfaceAttributeCollection- Specified by:
clonein interfaceAttributeProvider- Overrides:
clonein classAbstractAttributeProvider- Returns:
- the deep copy.
-
fireAttributeAddedEvent
protected void fireAttributeAddedEvent(String name, AttributeValue attr)
Fire the addition event.- Parameters:
name- is the name of the attribute for which the event occured.attr- is the value of the attribute.
-
fireAttributeChangedEvent
protected void fireAttributeChangedEvent(String name, AttributeValue oldValue, AttributeValue currentValue)
Fire the attribute change event.- Parameters:
name- is the name of the attribute for which the event occured.oldValue- is the previous value of the attributecurrentValue- is the current value of the attribute
-
fireAttributeClearedEvent
protected void fireAttributeClearedEvent()
Fire the all attribute removal event.
-
fireAttributeRemovedEvent
protected void fireAttributeRemovedEvent(String name, AttributeValue oldValue)
Fire the an attribute removal event.- Parameters:
name- is the name of the attribute for which the event occured.oldValue- is the previous value of the attribute
-
fireAttributeRenamedEvent
protected void fireAttributeRenamedEvent(String oldName, String newName, AttributeValue attr)
Fire the renaming event.- Parameters:
oldName- is the previous name of the attribute (before renaming)newName- is the new name of the attribute (after renaming)attr- is the value of the attribute.
-
addAttributeChangeListener
public void addAttributeChangeListener(AttributeChangeListener listener)
Description copied from interface:AttributeCollectionAdd a listener on the attribute value changes.- Specified by:
addAttributeChangeListenerin interfaceAttributeCollection- Parameters:
listener- the listener.
-
removeAttributeChangeListener
public void removeAttributeChangeListener(AttributeChangeListener listener)
Description copied from interface:AttributeCollectionRemove a listener on the attribute value changes.- Specified by:
removeAttributeChangeListenerin interfaceAttributeCollection- Parameters:
listener- the listener.
-
renameAttribute
public final boolean renameAttribute(String oldname, String newname)
Description copied from interface:AttributeCollectionRename the attribute.If a attribute named
newnamealready exists, this function will replyfalse.This function is equivalent to
renameAttribute(oldname, newname, false).- Specified by:
renameAttributein interfaceAttributeCollection- Parameters:
oldname- is the name of the attribute to rename.newname- is the new name of the attribute.- Returns:
falseif something wrong appends
-
-