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 voidaddAttributeChangeListener(AttributeChangeListener listener)Add a listener on the attribute value changes.voidaddAttributes(Map<String,Object> otherContainer)Put the values given as parameter in this attribute provider.voidaddAttributes(AttributeProvider otherContainer)Put the values given as parameter in this attribute provider.DBaseFileAttributeCollectionclone()Make a deep copy of this object and replies the copy.voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.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.voidflush()Force this provider to synchronized the memory state of the attributes with a remote storage area.voidfreeMemory()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.AttributeValuegetAttribute(String name)Replies the value for the given attribute.booleangetAttribute(String name, boolean defaultValue)Replies the value for the given attribute.doublegetAttribute(String name, double defaultValue)Replies the value for the given attribute.floatgetAttribute(String name, float defaultValue)Replies the value for the given attribute.intgetAttribute(String name, int defaultValue)Replies the value for the given attribute.longgetAttribute(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.StringgetAttribute(String name, String defaultValue)Replies the value for the given attribute.InetAddressgetAttribute(String name, InetAddress defaultValue)Replies the value for the given attribute.URIgetAttribute(String name, URI defaultValue)Replies the value for the given attribute.URLgetAttribute(String name, URL defaultValue)Replies the value for the given attribute.DategetAttribute(String name, Date defaultValue)Replies the value for the given attribute.UUIDgetAttribute(String name, UUID defaultValue)Replies the value for the given attribute.AttributeValuegetAttribute(String name, AttributeValue default_value)Replies the value for the given attribute.booleangetAttributeAsBool(String name)Replies the value for the given attribute.DategetAttributeAsDate(String name)Replies the value for the given attribute.doublegetAttributeAsDouble(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.floatgetAttributeAsFloat(String name)Replies the value for the given attribute.InetAddressgetAttributeAsInetAddress(String name)Replies the value for the given attribute.intgetAttributeAsInt(String name)Replies the value for the given attribute.longgetAttributeAsLong(String name)Replies the value for the given attribute.StringgetAttributeAsString(String name)Replies the value for the given attribute.URIgetAttributeAsURI(String name)Replies the value for the given attribute.URLgetAttributeAsURL(String name)Replies the value for the given attribute.UUIDgetAttributeAsUUID(String name)Replies the value for the given attribute.intgetAttributeCount()Replies the count of attributes.AttributegetAttributeObject(String name)Replies the attribute with the given name.intgetBufferedAttributeCount()Replies the count of buffered attributes.booleanhasAttribute(String name)Replies if the given attribute exists.booleanisBufferedAttribute(String attributeName)Replies if the specified attribute name corresponds to a buffered attribute value.booleanisEventFirable()Replies if the events are fired by this container.booleanremoveAllAttributes()Remove all the attributes.booleanremoveAttribute(String name)Remove the given attribute.voidremoveAttributeChangeListener(AttributeChangeListener listener)Remove a listener on the attribute value changes.booleanrenameAttribute(String oldname, String newname)Rename the attribute.booleanrenameAttribute(String oldname, String newname, boolean overwrite)Rename the attribute .AttributesetAttribute(String name, boolean value)Set the value for the given attribute.AttributesetAttribute(String name, double value)Set the value for the given attribute.AttributesetAttribute(String name, float value)Set the value for the given attribute.AttributesetAttribute(String name, int value)Set the value for the given attribute.AttributesetAttribute(String name, long value)Set the value for the given attribute.AttributesetAttribute(String name, Class<?> value)Set the value for the given attribute.AttributesetAttribute(String name, Enum<?> value)Set the value for the given attribute.AttributesetAttribute(String name, String value)Set the value for the given attribute.AttributesetAttribute(String name, InetAddress value)Set the value for the given attribute.AttributesetAttribute(String name, InetSocketAddress value)Set the value for the given attribute.AttributesetAttribute(String name, URI value)Set the value for the given attribute.AttributesetAttribute(String name, URL value)Set the value for the given attribute.AttributesetAttribute(String name, Date value)Set the value for the given attribute.AttributesetAttribute(String name, UUID value)Set the value for the given attribute.AttributesetAttribute(String name, AttributeValue value)Set the value for the given attribute.AttributesetAttribute(Attribute value)Set the value for the given attribute.voidsetAttributes(Map<String,Object> otherContainer)Set the content of this collection from the given map.voidsetAttributes(AttributeProvider otherContainer)Set the content of this collection from the given map.AttributesetAttributeType(String name, AttributeType type)Set the type of the attribute with the given name.voidsetEventFirable(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: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.
-
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:
finalizein classDBaseFileAttributeProvider- Throws:
Throwable
-
clone
@Pure public DBaseFileAttributeCollection 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.
-
getAllBufferedAttributeNames
@Pure public Collection<String> getAllBufferedAttributeNames()
Description copied from interface:ROMBasedAttributeCollectionReplies the list of attributes that have changed.- Specified by:
getAllBufferedAttributeNamesin 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:ROMBasedAttributeCollectionReplies the count of buffered attributes.- Specified by:
getBufferedAttributeCountin interfaceROMBasedAttributeCollection- Returns:
- the count of buffered attributes.
-
getAllBufferedAttributes
@Pure public Collection<Attribute> getAllBufferedAttributes()
Description copied from interface:ROMBasedAttributeCollectionReplies the list of attributes that have changed.- Specified by:
getAllBufferedAttributesin interfaceROMBasedAttributeCollection- Returns:
- the list of attributes stored inside the memory buffer.
-
isBufferedAttribute
@Pure public boolean isBufferedAttribute(String attributeName)
Description copied from interface:ROMBasedAttributeCollectionReplies if the specified attribute name corresponds to a buffered attribute value.- Specified by:
isBufferedAttributein interfaceROMBasedAttributeCollection- Parameters:
attributeName- the name.- Returns:
trueif 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:AttributeCollectionSet the type of the attribute with the given name.- Specified by:
setAttributeTypein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein 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:AttributeCollectionRemove the given attribute.- Specified by:
removeAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to remove.- Returns:
trueon success, otherwhisefalse
-
removeAllAttributes
public boolean removeAllAttributes()
Description copied from interface:AttributeCollectionRemove all the attributes.- Specified by:
removeAllAttributesin interfaceAttributeCollection- Returns:
falseif something wrong appends
-
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
-
renameAttribute
public boolean renameAttribute(String oldname, String newname, boolean overwrite)
Description copied from interface:AttributeCollectionRename the attribute .- Specified by:
renameAttributein interfaceAttributeCollection- Parameters:
oldname- is the name of the attribute to rename.newname- is the new name of the attribute.overwrite- must betrueif the value of an existing attribute named bynewnamemust be overwritten by the value of the attribute namedoldname.- Returns:
falseif something wrong appends
-
setAttributes
public void setAttributes(AttributeProvider otherContainer) throws AttributeException
Description copied from interface:AttributeCollectionSet 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:
setAttributesin 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:AttributeCollectionSet 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:
setAttributesin interfaceAttributeCollection- Parameters:
otherContainer- is the content.- See Also:
AttributeCollection.addAttributes(Map)
-
addAttributes
public void addAttributes(Map<String,Object> otherContainer)
Description copied from interface:AttributeCollectionPut 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:
addAttributesin 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:AttributeCollectionPut 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:
addAttributesin 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: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.
-
getAttributeCount
@Pure public int getAttributeCount()
Description copied from interface:AttributeProviderReplies the count of attributes.- Specified by:
getAttributeCountin interfaceAttributeProvider- Overrides:
getAttributeCountin classDBaseFileAttributeProvider- Returns:
- the count of attributes.
-
hasAttribute
@Pure public boolean hasAttribute(String name)
Description copied from interface:AttributeProviderReplies if the given attribute exists.- Specified by:
hasAttributein interfaceAttributeProvider- Overrides:
hasAttributein classDBaseFileAttributeProvider- Parameters:
name- the name.- Returns:
trueis an attribute with the given name exists, otherwisefalse
-
getAllAttributes
@Pure public Collection<Attribute> getAllAttributes()
Description copied from interface:AttributeProviderReplies all the attributes.- Specified by:
getAllAttributesin interfaceAttributeProvider- Overrides:
getAllAttributesin classDBaseFileAttributeProvider- Returns:
- the list of all attributes
-
getAllAttributeNames
@Pure public Collection<String> getAllAttributeNames()
Description copied from interface:AttributeProviderReplies all the attribute names. This function never load the attribute values even if they are not inside the storage layer.- Specified by:
getAllAttributeNamesin interfaceAttributeProvider- Overrides:
getAllAttributeNamesin classDBaseFileAttributeProvider- Returns:
- the list of all attribute names.
-
getAllAttributesByType
@Pure public Map<AttributeType,Collection<Attribute>> getAllAttributesByType()
Description copied from interface:AttributeProviderReplies 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:
getAllAttributesByTypein interfaceAttributeProvider- Overrides:
getAllAttributesByTypein classDBaseFileAttributeProvider- Returns:
- the attributes grouped by type.
-
getAttribute
@Pure public AttributeValue getAttribute(String name)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein classDBaseFileAttributeProvider- Parameters:
name- the name.- Returns:
- the value or
null
-
getAttribute
@Pure public boolean getAttribute(String name, boolean defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Overrides:
getAttributein 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:AttributeProviderReplies the attribute with the given name.- Specified by:
getAttributeObjectin interfaceAttributeProvider- Overrides:
getAttributeObjectin classDBaseFileAttributeProvider- Parameters:
name- the name.- Returns:
- the attribute or
null
-
getAttributeAsBool
@Pure public boolean getAttributeAsBool(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsBoolin interfaceAttributeProvider- Overrides:
getAttributeAsBoolin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsIntin interfaceAttributeProvider- Overrides:
getAttributeAsIntin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsLongin interfaceAttributeProvider- Overrides:
getAttributeAsLongin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsFloatin interfaceAttributeProvider- Overrides:
getAttributeAsFloatin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsDoublein interfaceAttributeProvider- Overrides:
getAttributeAsDoublein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsStringin interfaceAttributeProvider- Overrides:
getAttributeAsStringin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsUUIDin interfaceAttributeProvider- Overrides:
getAttributeAsUUIDin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsURLin interfaceAttributeProvider- Overrides:
getAttributeAsURLin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsURIin interfaceAttributeProvider- Overrides:
getAttributeAsURIin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsDatein interfaceAttributeProvider- Overrides:
getAttributeAsDatein 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsInetAddressin interfaceAttributeProvider- Overrides:
getAttributeAsInetAddressin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsEnumerationin interfaceAttributeProvider- Overrides:
getAttributeAsEnumerationin 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:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsEnumerationin interfaceAttributeProvider- Overrides:
getAttributeAsEnumerationin 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:
freeMemoryin interfaceAttributeProvider- Overrides:
freeMemoryin classDBaseFileAttributeProvider
-
flush
public void flush()
Description copied from interface:AttributeCollectionForce this provider to synchronized the memory state of the attributes with a remote storage area.- Specified by:
flushin 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.
-
-