Package org.arakhne.afc.attrs.collection
Interface AttributeProvider
-
- All Superinterfaces:
Cloneable
,JsonableObject
,Serializable
- All Known Subinterfaces:
AttributeCollection
,BoundedGISElement
,BusPrimitive<CONTAINER>
,GISContentElement<C>
,GISElement
,RoadNetwork
,RoadSegment
,ROMBasedAttributeCollection
- All Known Implementing Classes:
AbstractAttributeCollection
,AbstractAttributeProvider
,AbstractBoundedGISElement
,AbstractBufferedAttributeProvider
,AbstractBusContainer
,AbstractBusPrimitive
,AbstractGISElement
,ArrayMapElementLayer
,BufferedAttributeCollection
,BusHub
,BusItinerary
,BusItineraryHalt
,BusItineraryLayer
,BusLine
,BusLineLayer
,BusNetwork
,BusNetworkLayer
,BusStop
,DBaseFileAttributeAccessor
,DBaseFileAttributeCollection
,DBaseFileAttributeProvider
,GridMapElementLayer
,HeapAttributeCollection
,MapCircle
,MapComposedElement
,MapElement
,MapElementLayer
,MapLayer
,MapMultiPoint
,MapPoint
,MapPolygon
,MapPolyline
,MapPonctualElement
,MultiAttributeCollection
,MultiAttributeProvider
,MultiMapLayer
,RoadAStar.VirtualSegment
,RoadNetworkLayer
,RoadPolyline
,StandardRoadNetwork
,SubRoadNetwork.WrapSegment
,TreeMapElementLayer
public interface AttributeProvider extends Cloneable, Serializable, JsonableObject
This interface representes a provider of attributes that provide a reading API only.- 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 Default Methods Modifier and Type Method Description Iterable<Attribute>
attributes()
Replies all the attributes.AttributeProvider
clone()
Make a deep copy of this object and replies the copy.void
freeMemory()
Clean the internal memory-storage structures if they exist.Collection<String>
getAllAttributeNames()
Replies all the attribute names.Collection<Attribute>
getAllAttributes()
Replies all the attributes.Map<AttributeType,Collection<Attribute>>
getAllAttributesByType()
Replies all the attributes sorted by type.AttributeValue
getAttribute(String name)
Replies the value for the given attribute.boolean
getAttribute(String name, boolean defaultValue)
Replies the value for the given attribute.double
getAttribute(String name, double defaultValue)
Replies the value for the given attribute.float
getAttribute(String name, float defaultValue)
Replies the value for the given attribute.int
getAttribute(String name, int defaultValue)
Replies the value for the given attribute.long
getAttribute(String name, long defaultValue)
Replies the value for the given attribute.Class<?>
getAttribute(String name, Class<?> defaultValue)
Replies the value for the given attribute.String
getAttribute(String name, String defaultValue)
Replies the value for the given attribute.InetAddress
getAttribute(String name, InetAddress defaultValue)
Replies the value for the given attribute.InetAddress
getAttribute(String name, InetSocketAddress defaultValue)
Replies the value for the given attribute.URI
getAttribute(String name, URI defaultValue)
Replies the value for the given attribute.URL
getAttribute(String name, URL defaultValue)
Replies the value for the given attribute.Date
getAttribute(String name, Date defaultValue)
Replies the value for the given attribute.UUID
getAttribute(String name, UUID defaultValue)
Replies the value for the given attribute.AttributeValue
getAttribute(String name, AttributeValue defaultValue)
Replies the value for the given attribute.<T extends Enum<T>>
TgetAttribute(String name, T defaultValue)
Replies the value for the given attribute.boolean
getAttributeAsBool(String name)
Replies the value for the given attribute.Date
getAttributeAsDate(String name)
Replies the value for the given attribute.double
getAttributeAsDouble(String name)
Replies the value for the given attribute.Enum<?>
getAttributeAsEnumeration(String name)
Replies the value for the given attribute.<T extends Enum<T>>
TgetAttributeAsEnumeration(String name, Class<T> type)
Replies the value for the given attribute.float
getAttributeAsFloat(String name)
Replies the value for the given attribute.InetAddress
getAttributeAsInetAddress(String name)
Replies the value for the given attribute.int
getAttributeAsInt(String name)
Replies the value for the given attribute.Class<?>
getAttributeAsJavaClass(String name)
Replies the value for the given attribute.long
getAttributeAsLong(String name)
Replies the value for the given attribute.String
getAttributeAsString(String name)
Replies the value for the given attribute.URI
getAttributeAsURI(String name)
Replies the value for the given attribute.URL
getAttributeAsURL(String name)
Replies the value for the given attribute.UUID
getAttributeAsUUID(String name)
Replies the value for the given attribute.int
getAttributeCount()
Replies the count of attributes.Attribute
getAttributeObject(String name)
Replies the attribute with the given name.boolean
hasAttribute(String name)
Replies if the given attribute exists.default Map<String,Object>
toMap()
Replies the map of the values stored in this attribute provider.void
toMap(Map<String,Object> mapToFill)
Fill the given map with the values stored in this attribute provider.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
-
-
-
Method Detail
-
clone
@Pure AttributeProvider clone()
Make a deep copy of this object and replies the copy.- Returns:
- the deep copy.
-
getAttributeCount
@Pure int getAttributeCount()
Replies the count of attributes.- Returns:
- the count of attributes.
-
hasAttribute
@Pure boolean hasAttribute(String name)
Replies if the given attribute exists.- Parameters:
name
- the name.- Returns:
true
is an attribute with the given name exists, otherwisefalse
-
getAllAttributes
@Pure Collection<Attribute> getAllAttributes()
Replies all the attributes.- Returns:
- the list of all attributes
-
attributes
@Pure Iterable<Attribute> attributes()
Replies all the attributes.- Returns:
- an iterable object that contains the attributes.
-
getAllAttributesByType
@Pure Map<AttributeType,Collection<Attribute>> getAllAttributesByType()
Replies all the attributes sorted by type.The keys of the returned hashtable are the types and the values are array of attributes (
Vector
).- Returns:
- the attributes grouped by type.
-
getAllAttributeNames
@Pure Collection<String> getAllAttributeNames()
Replies all the attribute names. This function never load the attribute values even if they are not inside the storage layer.- Returns:
- the list of all attribute names.
-
getAttribute
@Pure AttributeValue getAttribute(String name)
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value or
null
-
getAttribute
@Pure boolean getAttribute(String name, boolean defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure int getAttribute(String name, int defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure long getAttribute(String name, long defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure float getAttribute(String name, float defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure double getAttribute(String name, double defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure String getAttribute(String name, String defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure UUID getAttribute(String name, UUID defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure URL getAttribute(String name, URL defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure URI getAttribute(String name, URI defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure Date getAttribute(String name, Date defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure AttributeValue getAttribute(String name, AttributeValue defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value or
null
-
getAttribute
@Pure InetAddress getAttribute(String name, InetAddress defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure InetAddress getAttribute(String name, InetSocketAddress defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure <T extends Enum<T>> T getAttribute(String name, T defaultValue)
Replies the value for the given attribute.- Type Parameters:
T
- is the type of the enumeration.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure Class<?> getAttribute(String name, Class<?> defaultValue)
Replies the value for the given attribute.- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttributeObject
@Pure Attribute getAttributeObject(String name)
Replies the attribute with the given name.- Parameters:
name
- the name.- Returns:
- the attribute or
null
-
getAttributeAsBool
@Pure boolean getAttributeAsBool(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsInt
@Pure int getAttributeAsInt(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsLong
@Pure long getAttributeAsLong(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsFloat
@Pure float getAttributeAsFloat(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsDouble
@Pure double getAttributeAsDouble(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsString
@Pure String getAttributeAsString(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsUUID
@Pure UUID getAttributeAsUUID(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsURL
@Pure URL getAttributeAsURL(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsURI
@Pure URI getAttributeAsURI(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsDate
@Pure Date getAttributeAsDate(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsInetAddress
@Pure InetAddress getAttributeAsInetAddress(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsEnumeration
@Pure Enum<?> getAttributeAsEnumeration(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsEnumeration
@Pure <T extends Enum<T>> T getAttributeAsEnumeration(String name, Class<T> type) throws AttributeException
Replies the value for the given attribute.- Type Parameters:
T
- is the type of the enumeration to retreive.- Parameters:
name
- the name.type
- is the type of the enumeration to retreive.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsJavaClass
@Pure Class<?> getAttributeAsJavaClass(String name) throws AttributeException
Replies the value for the given attribute.- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
freeMemory
void freeMemory()
Clean the internal memory-storage structures if they exist.This function permits to limit the memory usage without removing the attribute value from a hard storage area (database, files...). The attribute which are freed by this method could be reloaded in memory with a call to a getting method.
-
toMap
@Pure default Map<String,Object> toMap()
Replies the map of the values stored in this attribute provider. The replied map is a copy of or an unmodifiable version of the internal map, if it exists.q- Returns:
- the map, never
null
.
-
-