Package org.arakhne.afc.io.dbase.attr
Class DBaseFileAttributeCollection
- java.lang.Object
-
- org.arakhne.afc.attrs.collection.AbstractAttributeProvider
-
- org.arakhne.afc.io.dbase.attr.DBaseFileAttributeProvider
-
- org.arakhne.afc.io.dbase.attr.DBaseFileAttributeCollection
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Attribute>
,AttributeCollection
,AttributeProvider
,ROMBasedAttributeCollection
,JsonableObject
public class DBaseFileAttributeCollection extends DBaseFileAttributeProvider implements ROMBasedAttributeCollection
This class permits to access to the attributes stored inside a dBase file.This class uses a syndicate to access to a single dBase file, assuming that an attribute provider accesses only one record of the dBase file.
This class is a container of attributes that access to one record of a dBase file.
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:52
- Author:
- Stéphane GALLAND
- See Also:
DBaseFileAttributeProvider
, Serialized Form- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- dbasefile
-
-
Constructor Summary
Constructors Constructor Description DBaseFileAttributeCollection(DBaseFileAttributeAccessor accessor)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAttributeChangeListener(AttributeChangeListener listener)
Add a listener on the attribute value changes.void
addAttributes(Map<String,Object> otherContainer)
Put the values given as parameter in this attribute provider.void
addAttributes(AttributeProvider otherContainer)
Put the values given as parameter in this attribute provider.DBaseFileAttributeCollection
clone()
Make a deep copy of this object and replies the copy.void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.protected void
fireAttributeAddedEvent(String name, AttributeValue attr)
Fire the addition event.protected void
fireAttributeChangedEvent(String name, AttributeValue oldValue, AttributeValue currentValue)
Fire the attribute change event.protected void
fireAttributeClearedEvent()
Fire the all attribute removal event.protected void
fireAttributeRemovedEvent(String name, AttributeValue oldValue)
Fire the an attribute removal event.protected void
fireAttributeRenamedEvent(String oldName, String newName, AttributeValue attr)
Fire the renaming event.void
flush()
Force this provider to synchronized the memory state of the attributes with a remote storage area.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.Collection<String>
getAllBufferedAttributeNames()
Replies the list of attributes that have changed.Collection<Attribute>
getAllBufferedAttributes()
Replies the list of attributes that have changed.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.<ET extends Enum<ET>>
ETgetAttribute(String name, ET 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.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 default_value)
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.<ET extends Enum<ET>>
ETgetAttributeAsEnumeration(String name, Class<ET> 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.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.int
getBufferedAttributeCount()
Replies the count of buffered attributes.boolean
hasAttribute(String name)
Replies if the given attribute exists.boolean
isBufferedAttribute(String attributeName)
Replies if the specified attribute name corresponds to a buffered attribute value.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> otherContainer)
Set the content of this collection from the given map.void
setAttributes(AttributeProvider otherContainer)
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 class org.arakhne.afc.io.dbase.attr.DBaseFileAttributeProvider
getAttributeObjectFromDBase, getRecordNumber, getResource, hasAttributeInDBase, toMap
-
Methods inherited from class org.arakhne.afc.attrs.collection.AbstractAttributeProvider
attributes, getAttribute, getAttribute, getAttributeAsJavaClass, iterator, protectNull, toJson, toString, unprotectNull
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeProvider
attributes, getAttribute, getAttribute, getAttributeAsJavaClass, toMap, toMap
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
-
-
-
Constructor Detail
-
DBaseFileAttributeCollection
DBaseFileAttributeCollection(DBaseFileAttributeAccessor accessor)
Constructor.- Parameters:
accessor
- is the object that permits to access to the dBase resource.
-
-
Method Detail
-
isEventFirable
@Pure public boolean isEventFirable()
Description copied from interface:AttributeCollection
Replies if the events are fired by this container.- Specified by:
isEventFirable
in interfaceAttributeCollection
- Returns:
true
if the events are fired; otherwisefalse
if events are not fired.
-
setEventFirable
public void setEventFirable(boolean isFirable)
Description copied from interface:AttributeCollection
Set if the events are fired by this container.- Specified by:
setEventFirable
in interfaceAttributeCollection
- Parameters:
isFirable
- istrue
if the events are fired; otherwisefalse
if events are not fired.
-
finalize
@Deprecated(since="17.0", forRemoval=true) public void finalize() throws Throwable
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
finalize
in classDBaseFileAttributeProvider
- Throws:
Throwable
-
clone
@Pure public DBaseFileAttributeCollection clone()
Make a deep copy of this object and replies the copy.- Specified by:
clone
in interfaceAttributeCollection
- Specified by:
clone
in interfaceAttributeProvider
- Overrides:
clone
in classAbstractAttributeProvider
- Returns:
- the deep copy.
-
getAllBufferedAttributeNames
@Pure public Collection<String> getAllBufferedAttributeNames()
Description copied from interface:ROMBasedAttributeCollection
Replies the list of attributes that have changed.- Specified by:
getAllBufferedAttributeNames
in interfaceROMBasedAttributeCollection
- Returns:
- the list of the names of the attributes which are stored inside the memory buffer.
-
getBufferedAttributeCount
@Pure public int getBufferedAttributeCount()
Description copied from interface:ROMBasedAttributeCollection
Replies the count of buffered attributes.- Specified by:
getBufferedAttributeCount
in interfaceROMBasedAttributeCollection
- Returns:
- the count of buffered attributes.
-
getAllBufferedAttributes
@Pure public Collection<Attribute> getAllBufferedAttributes()
Description copied from interface:ROMBasedAttributeCollection
Replies the list of attributes that have changed.- Specified by:
getAllBufferedAttributes
in interfaceROMBasedAttributeCollection
- Returns:
- the list of attributes stored inside the memory buffer.
-
isBufferedAttribute
@Pure public boolean isBufferedAttribute(String attributeName)
Description copied from interface:ROMBasedAttributeCollection
Replies if the specified attribute name corresponds to a buffered attribute value.- Specified by:
isBufferedAttribute
in interfaceROMBasedAttributeCollection
- Parameters:
attributeName
- the name.- Returns:
true
if an attribute with the given name is stored inside the memory buffer, otherwisefalse
-
setAttributeType
public Attribute setAttributeType(String name, AttributeType type) throws AttributeException
Description copied from interface:AttributeCollection
Set the type of the attribute with the given name.- Specified by:
setAttributeType
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attributetype
- is the desired type.- Returns:
- the changed attribute or
null
- Throws:
AttributeException
- on error.
-
setAttribute
public Attribute setAttribute(String name, AttributeValue value) throws AttributeException
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- 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
public Attribute setAttribute(String name, boolean value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, int value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, long value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, float value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, double value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, String value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, UUID value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, URL value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, URI value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, Date value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, InetAddress value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, InetSocketAddress value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, Enum<?> value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, Class<?> value)
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to set.value
- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(Attribute value) throws AttributeException
Description copied from interface:AttributeCollection
Set the value for the given attribute.- Specified by:
setAttribute
in interfaceAttributeCollection
- Parameters:
value
- is the value to store.- Returns:
- the changed attribute or
null
- Throws:
AttributeException
- on error.
-
removeAttribute
public boolean removeAttribute(String name)
Description copied from interface:AttributeCollection
Remove the given attribute.- Specified by:
removeAttribute
in interfaceAttributeCollection
- Parameters:
name
- is the name of the attribute to remove.- Returns:
true
on success, otherwhisefalse
-
removeAllAttributes
public boolean removeAllAttributes()
Description copied from interface:AttributeCollection
Remove all the attributes.- Specified by:
removeAllAttributes
in interfaceAttributeCollection
- Returns:
false
if something wrong appends
-
renameAttribute
public final boolean renameAttribute(String oldname, String newname)
Description copied from interface:AttributeCollection
Rename the attribute.If a attribute named
newname
already exists, this function will replyfalse
.This function is equivalent to
renameAttribute(oldname, newname, false)
.- Specified by:
renameAttribute
in interfaceAttributeCollection
- 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
public boolean renameAttribute(String oldname, String newname, boolean overwrite)
Description copied from interface:AttributeCollection
Rename the attribute .- Specified by:
renameAttribute
in interfaceAttributeCollection
- 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
-
setAttributes
public void setAttributes(AttributeProvider otherContainer) throws AttributeException
Description copied from interface:AttributeCollection
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);
- Specified by:
setAttributes
in interfaceAttributeCollection
- Parameters:
otherContainer
- is the content.- Throws:
AttributeException
- if one attribute from the content cannot be inserted.- See Also:
AttributeCollection.addAttributes(AttributeProvider)
-
setAttributes
public void setAttributes(Map<String,Object> otherContainer)
Description copied from interface:AttributeCollection
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);
- Specified by:
setAttributes
in interfaceAttributeCollection
- Parameters:
otherContainer
- is the content.- See Also:
AttributeCollection.addAttributes(Map)
-
addAttributes
public void addAttributes(Map<String,Object> otherContainer)
Description copied from interface:AttributeCollection
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.- Specified by:
addAttributes
in interfaceAttributeCollection
- Parameters:
otherContainer
- is the content to add inside.- See Also:
AttributeCollection.setAttributes(Map)
-
addAttributes
public void addAttributes(AttributeProvider otherContainer) throws AttributeException
Description copied from interface:AttributeCollection
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.- Specified by:
addAttributes
in interfaceAttributeCollection
- Parameters:
otherContainer
- is the content to add inside.- Throws:
AttributeException
- if one attribute from the content cannot be inserted.- See Also:
AttributeCollection.addAttributes(AttributeProvider)
-
addAttributeChangeListener
public void addAttributeChangeListener(AttributeChangeListener listener)
Description copied from interface:AttributeCollection
Add a listener on the attribute value changes.- Specified by:
addAttributeChangeListener
in interfaceAttributeCollection
- Parameters:
listener
- the listener.
-
removeAttributeChangeListener
public void removeAttributeChangeListener(AttributeChangeListener listener)
Description copied from interface:AttributeCollection
Remove a listener on the attribute value changes.- Specified by:
removeAttributeChangeListener
in interfaceAttributeCollection
- Parameters:
listener
- the listener.
-
getAttributeCount
@Pure public int getAttributeCount()
Description copied from interface:AttributeProvider
Replies the count of attributes.- Specified by:
getAttributeCount
in interfaceAttributeProvider
- Overrides:
getAttributeCount
in classDBaseFileAttributeProvider
- Returns:
- the count of attributes.
-
hasAttribute
@Pure public boolean hasAttribute(String name)
Description copied from interface:AttributeProvider
Replies if the given attribute exists.- Specified by:
hasAttribute
in interfaceAttributeProvider
- Overrides:
hasAttribute
in classDBaseFileAttributeProvider
- Parameters:
name
- the name.- Returns:
true
is an attribute with the given name exists, otherwisefalse
-
getAllAttributes
@Pure public Collection<Attribute> getAllAttributes()
Description copied from interface:AttributeProvider
Replies all the attributes.- Specified by:
getAllAttributes
in interfaceAttributeProvider
- Overrides:
getAllAttributes
in classDBaseFileAttributeProvider
- Returns:
- the list of all attributes
-
getAllAttributeNames
@Pure public Collection<String> getAllAttributeNames()
Description copied from interface:AttributeProvider
Replies all the attribute names. This function never load the attribute values even if they are not inside the storage layer.- Specified by:
getAllAttributeNames
in interfaceAttributeProvider
- Overrides:
getAllAttributeNames
in classDBaseFileAttributeProvider
- Returns:
- the list of all attribute names.
-
getAllAttributesByType
@Pure public Map<AttributeType,Collection<Attribute>> getAllAttributesByType()
Description copied from interface:AttributeProvider
Replies all the attributes sorted by type.The keys of the returned hashtable are the types and the values are array of attributes (
Vector
).- Specified by:
getAllAttributesByType
in interfaceAttributeProvider
- Overrides:
getAllAttributesByType
in classDBaseFileAttributeProvider
- Returns:
- the attributes grouped by type.
-
getAttribute
@Pure public AttributeValue getAttribute(String name)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classDBaseFileAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value or
null
-
getAttribute
@Pure public boolean getAttribute(String name, boolean defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public long getAttribute(String name, long defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public int getAttribute(String name, int defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public float getAttribute(String name, float defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public double getAttribute(String name, double defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public String getAttribute(String name, String defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public UUID getAttribute(String name, UUID defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public URL getAttribute(String name, URL defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public URI getAttribute(String name, URI defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public Date getAttribute(String name, Date defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public InetAddress getAttribute(String name, InetAddress defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Parameters:
name
- the name.defaultValue
- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
@Pure public <ET extends Enum<ET>> ET getAttribute(String name, ET defaultValue)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classAbstractAttributeProvider
- Type Parameters:
ET
- 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 public AttributeValue getAttribute(String name, AttributeValue default_value)
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttribute
in interfaceAttributeProvider
- Overrides:
getAttribute
in classDBaseFileAttributeProvider
- Parameters:
name
- the name.default_value
- is the default value replied if the attribute has no value.- Returns:
- the value or
null
-
getAttributeObject
@Pure public Attribute getAttributeObject(String name)
Description copied from interface:AttributeProvider
Replies the attribute with the given name.- Specified by:
getAttributeObject
in interfaceAttributeProvider
- Overrides:
getAttributeObject
in classDBaseFileAttributeProvider
- Parameters:
name
- the name.- Returns:
- the attribute or
null
-
getAttributeAsBool
@Pure public boolean getAttributeAsBool(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsBool
in interfaceAttributeProvider
- Overrides:
getAttributeAsBool
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsInt
@Pure public int getAttributeAsInt(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsInt
in interfaceAttributeProvider
- Overrides:
getAttributeAsInt
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsLong
@Pure public long getAttributeAsLong(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsLong
in interfaceAttributeProvider
- Overrides:
getAttributeAsLong
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsFloat
@Pure public float getAttributeAsFloat(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsFloat
in interfaceAttributeProvider
- Overrides:
getAttributeAsFloat
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsDouble
@Pure public double getAttributeAsDouble(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsDouble
in interfaceAttributeProvider
- Overrides:
getAttributeAsDouble
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsString
@Pure public String getAttributeAsString(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsString
in interfaceAttributeProvider
- Overrides:
getAttributeAsString
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsUUID
@Pure public UUID getAttributeAsUUID(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsUUID
in interfaceAttributeProvider
- Overrides:
getAttributeAsUUID
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsURL
@Pure public URL getAttributeAsURL(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsURL
in interfaceAttributeProvider
- Overrides:
getAttributeAsURL
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsURI
@Pure public URI getAttributeAsURI(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsURI
in interfaceAttributeProvider
- Overrides:
getAttributeAsURI
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsDate
@Pure public Date getAttributeAsDate(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsDate
in interfaceAttributeProvider
- Overrides:
getAttributeAsDate
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsInetAddress
@Pure public InetAddress getAttributeAsInetAddress(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsInetAddress
in interfaceAttributeProvider
- Overrides:
getAttributeAsInetAddress
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsEnumeration
@Pure public Enum<?> getAttributeAsEnumeration(String name) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsEnumeration
in interfaceAttributeProvider
- Overrides:
getAttributeAsEnumeration
in classAbstractAttributeProvider
- Parameters:
name
- the name.- Returns:
- the value
- Throws:
AttributeException
- if the attribute was never set.
-
getAttributeAsEnumeration
@Pure public <ET extends Enum<ET>> ET getAttributeAsEnumeration(String name, Class<ET> type) throws AttributeException
Description copied from interface:AttributeProvider
Replies the value for the given attribute.- Specified by:
getAttributeAsEnumeration
in interfaceAttributeProvider
- Overrides:
getAttributeAsEnumeration
in classAbstractAttributeProvider
- Type Parameters:
ET
- 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.
-
freeMemory
public 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.
- Specified by:
freeMemory
in interfaceAttributeProvider
- Overrides:
freeMemory
in classDBaseFileAttributeProvider
-
flush
public void flush()
Description copied from interface:AttributeCollection
Force this provider to synchronized the memory state of the attributes with a remote storage area.- Specified by:
flush
in interfaceAttributeCollection
-
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.
-
-