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 void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.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.AttributeValue
getAttribute(String name, AttributeValue default_value)
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.protected Attribute
getAttributeObjectFromDBase(String name)
Replies the object directly form the dBase file.int
getRecordNumber()
Replies the index of the attributes inside the dBase file.URL
getResource()
Replies the URL where the dBase file is located.boolean
hasAttribute(String name)
Replies if the given attribute exists.protected boolean
hasAttributeInDBase(String name)
Replies if the specified attribute exists inside the dBase file.void
toMap(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:AttributeProvider
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.
-
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.- Returns:
- the list of all attribute names.
-
getAllAttributes
@Pure public Collection<Attribute> getAllAttributes()
Description copied from interface:AttributeProvider
Replies all the attributes.- Returns:
- the list of all attributes
-
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
).- 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.- Parameters:
name
- the name.- Returns:
- the value or
null
-
getAttribute
@Pure public AttributeValue getAttribute(String name, AttributeValue default_value)
Description copied from interface:AttributeProvider
Replies 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:AttributeProvider
Replies 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:AttributeProvider
Replies if the given attribute exists.- Parameters:
name
- the name.- Returns:
true
is 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:
true
if the given attribute exists inside the dBase file, otherwisefalse
-
getAttributeCount
@Pure public int getAttributeCount()
Description copied from interface:AttributeProvider
Replies the count of attributes.- Returns:
- the count of attributes.
-
toMap
@Pure public void toMap(Map<String,Object> mapToFill)
Description copied from interface:AttributeProvider
Fill the given map with the values stored in this attribute provider.- Parameters:
mapToFill
- is the map to fill, nevernull
.
-
-