Package org.arakhne.afc.attrs.collection
Interface AttributeCollection
-
- All Superinterfaces:
AttributeProvider
,Cloneable
,JsonableObject
,Serializable
- All Known Subinterfaces:
BoundedGISElement
,BusPrimitive<CONTAINER>
,GISContentElement<C>
,GISElement
,RoadNetwork
,RoadSegment
,ROMBasedAttributeCollection
- All Known Implementing Classes:
AbstractAttributeCollection
,AbstractBoundedGISElement
,AbstractBusContainer
,AbstractBusPrimitive
,AbstractGISElement
,ArrayMapElementLayer
,BufferedAttributeCollection
,BusHub
,BusItinerary
,BusItineraryHalt
,BusItineraryLayer
,BusLine
,BusLineLayer
,BusNetwork
,BusNetworkLayer
,BusStop
,DBaseFileAttributeCollection
,GridMapElementLayer
,HeapAttributeCollection
,MapCircle
,MapComposedElement
,MapElement
,MapElementLayer
,MapLayer
,MapMultiPoint
,MapPoint
,MapPolygon
,MapPolyline
,MapPonctualElement
,MultiAttributeCollection
,MultiMapLayer
,RoadAStar.VirtualSegment
,RoadNetworkLayer
,RoadPolyline
,StandardRoadNetwork
,SubRoadNetwork.WrapSegment
,TreeMapElementLayer
public interface AttributeCollection extends AttributeProvider
This interface representes an object that owns a collection of attributes with a reading and a writing API.- Version:
- 17.0 2020-01-04 14:41:51
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- attributes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAttributeChangeListener(AttributeChangeListener listener)
Add a listener on the attribute value changes.void
addAttributes(Map<String,Object> content)
Put the values given as parameter in this attribute provider.void
addAttributes(AttributeProvider content)
Put the values given as parameter in this attribute provider.AttributeCollection
clone()
Make a deep copy of this object and replies the copy.void
flush()
Force this provider to synchronized the memory state of the attributes with a remote storage area.boolean
isEventFirable()
Replies if the events are fired by this container.boolean
removeAllAttributes()
Remove all the attributes.boolean
removeAttribute(String name)
Remove the given attribute.void
removeAttributeChangeListener(AttributeChangeListener listener)
Remove a listener on the attribute value changes.boolean
renameAttribute(String oldname, String newname)
Rename the attribute.boolean
renameAttribute(String oldname, String newname, boolean overwrite)
Rename the attribute .Attribute
setAttribute(String name, boolean value)
Set the value for the given attribute.Attribute
setAttribute(String name, double value)
Set the value for the given attribute.Attribute
setAttribute(String name, float value)
Set the value for the given attribute.Attribute
setAttribute(String name, int value)
Set the value for the given attribute.Attribute
setAttribute(String name, long value)
Set the value for the given attribute.Attribute
setAttribute(String name, Class<?> value)
Set the value for the given attribute.Attribute
setAttribute(String name, Enum<?> value)
Set the value for the given attribute.Attribute
setAttribute(String name, String value)
Set the value for the given attribute.Attribute
setAttribute(String name, InetAddress value)
Set the value for the given attribute.Attribute
setAttribute(String name, InetSocketAddress value)
Set the value for the given attribute.Attribute
setAttribute(String name, URI value)
Set the value for the given attribute.Attribute
setAttribute(String name, URL value)
Set the value for the given attribute.Attribute
setAttribute(String name, Date value)
Set the value for the given attribute.Attribute
setAttribute(String name, UUID value)
Set the value for the given attribute.Attribute
setAttribute(String name, AttributeValue value)
Set the value for the given attribute.Attribute
setAttribute(Attribute value)
Set the value for the given attribute.void
setAttributes(Map<String,Object> content)
Set the content of this collection from the given map.void
setAttributes(AttributeProvider content)
Set the content of this collection from the given map.Attribute
setAttributeType(String name, AttributeType type)
Set the type of the attribute with the given name.void
setEventFirable(boolean isFirable)
Set if the events are fired by this container.-
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 org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
-
-
-
Method Detail
-
clone
@Pure AttributeCollection clone()
Make a deep copy of this object and replies the copy.- Specified by:
clone
in interfaceAttributeProvider
- Returns:
- the deep copy.
-
setAttributes
void setAttributes(Map<String,Object> content)
Set the content of this collection from the given map. Any previous content of this attribute collection will be lost. This function is equivalent to:this.removeAllAttributes(); this.addAttributes(content);
- Parameters:
content
- is the content.- See Also:
addAttributes(Map)
-
setAttributes
void setAttributes(AttributeProvider content) throws AttributeException
Set the content of this collection from the given map. Any previous content of this attribute collection will be lost. This function is equivalent to:this.removeAllAttributes(); this.addAttributes(content);
- Parameters:
content
- is the content.- Throws:
AttributeException
- if one attribute from the content cannot be inserted.- See Also:
addAttributes(AttributeProvider)
-
addAttributes
void addAttributes(Map<String,Object> content)
Put the values given as parameter in this attribute provider. Any previous content of this attribute collection will remain if the keys are not inside the given content. If the values from the given content will be used to overwrite any existing value.- Parameters:
content
- is the content to add inside.- See Also:
setAttributes(Map)
-
addAttributes
void addAttributes(AttributeProvider content) throws AttributeException
Put the values given as parameter in this attribute provider. Any previous content of this attribute collection will remain if the keys are not inside the given content. If the values from the given content will be used to overwrite any existing value.- Parameters:
content
- is the content to add inside.- Throws:
AttributeException
- if one attribute from the content cannot be inserted.- See Also:
addAttributes(AttributeProvider)
-
setAttribute
Attribute setAttribute(String name, AttributeValue value) throws AttributeException
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
- Throws:
AttributeException
- on error.
-
setAttribute
Attribute setAttribute(String name, boolean value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, int value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, long value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, float value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, double value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, String value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, UUID value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, URL value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, URI value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, Date value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, InetAddress value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, InetSocketAddress value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, Enum<?> value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(String name, Class<?> value)
Set the value for the given attribute.- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
Attribute setAttribute(Attribute value) throws AttributeException
Set the value for the given attribute.- Parameters:
value
- is the value to store.- Returns:
- the changed attribute or
null
- Throws:
AttributeException
- on error.
-
setAttributeType
Attribute setAttributeType(String name, AttributeType type) throws AttributeException
Set the type of the attribute with the given name.- Parameters:
name
- is the name of the attributetype
- is the desired type.- Returns:
- the changed attribute or
null
- Throws:
AttributeException
- on error.- Since:
- 4.0
-
removeAttribute
boolean removeAttribute(String name)
Remove the given attribute.- Parameters:
name
- is the name of the attribute to remove.- Returns:
true
on success, otherwhisefalse
-
removeAllAttributes
boolean removeAllAttributes()
Remove all the attributes.- Returns:
false
if something wrong appends
-
renameAttribute
boolean renameAttribute(String oldname, String newname)
Rename the attribute.If a attribute named
newname
already exists, this function will replyfalse
.This function is equivalent to
renameAttribute(oldname, newname, false)
.- Parameters:
oldname
- is the name of the attribute to rename.newname
- is the new name of the attribute.- Returns:
false
if something wrong appends
-
renameAttribute
boolean renameAttribute(String oldname, String newname, boolean overwrite)
Rename the attribute .- Parameters:
oldname
- is the name of the attribute to rename.newname
- is the new name of the attribute.overwrite
- must betrue
if the value of an existing attribute named bynewname
must be overwritten by the value of the attribute namedoldname
.- Returns:
false
if something wrong appends
-
addAttributeChangeListener
void addAttributeChangeListener(AttributeChangeListener listener)
Add a listener on the attribute value changes.- Parameters:
listener
- the listener.
-
removeAttributeChangeListener
void removeAttributeChangeListener(AttributeChangeListener listener)
Remove a listener on the attribute value changes.- Parameters:
listener
- the listener.
-
isEventFirable
@Pure boolean isEventFirable()
Replies if the events are fired by this container.- Returns:
true
if the events are fired; otherwisefalse
if events are not fired.
-
setEventFirable
void setEventFirable(boolean isFirable)
Set if the events are fired by this container.- Parameters:
isFirable
- istrue
if the events are fired; otherwisefalse
if events are not fired.
-
flush
void flush()
Force this provider to synchronized the memory state of the attributes with a remote storage area.
-
-