Package org.arakhne.afc.io.dbase.attr
Class DBaseFileAttributeProvider
- java.lang.Object
-
- org.arakhne.afc.attrs.collection.AbstractAttributeProvider
-
- org.arakhne.afc.io.dbase.attr.DBaseFileAttributeProvider
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Attribute>,AttributeProvider,JsonableObject
- Direct Known Subclasses:
DBaseFileAttributeCollection
public class DBaseFileAttributeProvider extends AbstractAttributeProvider
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,DBaseFileAttributeCollection, Serialized Form- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- dbasefile
-
-
Constructor Summary
Constructors Constructor Description DBaseFileAttributeProvider(DBaseFileAttributeAccessor accessor)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.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.AttributeValuegetAttribute(String name)Replies the value for the given attribute.AttributeValuegetAttribute(String name, AttributeValue default_value)Replies the value for the given attribute.intgetAttributeCount()Replies the count of attributes.AttributegetAttributeObject(String name)Replies the attribute with the given name.protected AttributegetAttributeObjectFromDBase(String name)Replies the object directly form the dBase file.intgetRecordNumber()Replies the index of the attributes inside the dBase file.URLgetResource()Replies the URL where the dBase file is located.booleanhasAttribute(String name)Replies if the given attribute exists.protected booleanhasAttributeInDBase(String name)Replies if the specified attribute exists inside the dBase file.voidtoMap(Map<String,Object> mapToFill)Fill the given map with the values stored in this attribute provider.-
Methods inherited from class org.arakhne.afc.attrs.collection.AbstractAttributeProvider
attributes, clone, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, iterator, protectNull, toJson, toString, unprotectNull
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeProvider
toMap
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DBaseFileAttributeProvider
DBaseFileAttributeProvider(DBaseFileAttributeAccessor accessor)
Constructor.- Parameters:
accessor- is the accessor that permits to obtain attributes from a dBase file.
-
-
Method Detail
-
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.
-
getResource
@Pure public URL getResource()
Replies the URL where the dBase file is located.- Returns:
- the URL where the dBase file is located.
-
getRecordNumber
@Pure public int getRecordNumber()
Replies the index of the attributes inside the dBase file.- Returns:
- the index of the attributes inside the dBase file.
-
freeMemory
public void freeMemory()
Description copied from interface:AttributeProviderClean 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.
-
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.- Returns:
- the list of all attribute names.
-
getAllAttributes
@Pure public Collection<Attribute> getAllAttributes()
Description copied from interface:AttributeProviderReplies all the attributes.- Returns:
- the list of all attributes
-
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).- Returns:
- the attributes grouped by type.
-
getAttribute
@Pure public AttributeValue getAttribute(String name)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Parameters:
name- the name.- Returns:
- the value or
null
-
getAttribute
@Pure public AttributeValue getAttribute(String name, AttributeValue default_value)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- 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.- Parameters:
name- the name.- Returns:
- the attribute or
null
-
getAttributeObjectFromDBase
protected final Attribute getAttributeObjectFromDBase(String name)
Replies the object directly form the dBase file.- Parameters:
name- the name.- Returns:
- the object directly form the dBase file.
-
hasAttribute
@Pure public boolean hasAttribute(String name)
Description copied from interface:AttributeProviderReplies if the given attribute exists.- Parameters:
name- the name.- Returns:
trueis an attribute with the given name exists, otherwisefalse
-
hasAttributeInDBase
@Pure protected final boolean hasAttributeInDBase(String name)
Replies if the specified attribute exists inside the dBase file.- Parameters:
name- the name.- Returns:
trueif the given attribute exists inside the dBase file, otherwisefalse
-
getAttributeCount
@Pure public int getAttributeCount()
Description copied from interface:AttributeProviderReplies the count of attributes.- Returns:
- the count of attributes.
-
toMap
@Pure public void toMap(Map<String,Object> mapToFill)
Description copied from interface:AttributeProviderFill the given map with the values stored in this attribute provider.- Parameters:
mapToFill- is the map to fill, nevernull.
-
-