All Packages Class Hierarchy This Package Previous Next Index
Interface tlk.data.DataAccess
- public abstract interface DataAccess
- extends Enumeration
This class allows access to certain data stored in some data format,
unknown to the caller. It basically intermediates access to the data
stored in a format. For each format there should be a DataAccess instance.
Thus it basically acts as a data type definition.
Currently, data is regarded as a set of name-value pairs, a name being
a certain string, a value a certain DataFieldValue Object.
The interface is still under heavy development changes. Please send
in your comments and suggestions.
Written: Radu Sion
Version: 0.12
Source: DataAccess.java
Visit
Smart Software
- See Also:
- DataFieldValue
-
getDataFieldNames()
- This method returns a vector of String Objects, containing the names
of all the fields accessible in this data type.
-
getDataFieldValue(String)
- Returns a value of a certain data field, identified by its name.
-
getVersion()
- Returns a certain version string of this data access object.
-
setData(Object)
- When this data access object is used to access external data, this method
should be used to set a reference to that external data.
-
setDataField(String, DataFieldValue)
- Sets a certain data field, creating a new one if necessary.
getVersion
public abstract String getVersion()
- Returns a certain version string of this data access object.
A higher number means a new version.
- Returns:
- a string containing a number formatted like 1.2.3
setData
public abstract boolean setData(Object data)
- When this data access object is used to access external data, this method
should be used to set a reference to that external data.
If the return is false, this interface is not suited for access to the
particular data provided as parameter. If the return is false, the
DataAccess object remains in a undefined state until another call to
setData returns true.
- Parameters:
- data - External data to access
- Returns:
- True if ok, false if not suited to access parameter data
getDataFieldNames
public abstract Vector getDataFieldNames()
- This method returns a vector of String Objects, containing the names
of all the fields accessible in this data type.
A default name has to be "name". A common name may be "data" in the case
of single data chunks for example.
- Returns:
- A vector of Strings or null on error
getDataFieldValue
public abstract DataFieldValue getDataFieldValue(String fieldname)
- Returns a value of a certain data field, identified by its name.
The value is returned as an DataFieldValue Object.
- Parameters:
- fieldname - Name identifying the field
- Returns:
- A DataFieldValue value of the field or null if field undefined or error.
setDataField
public abstract DataFieldValue setDataField(String fieldname,
DataFieldValue newvalue)
- Sets a certain data field, creating a new one if necessary.
If there is an existing data field with that particular name,
it's old value is returned.
- Parameters:
- fieldname - Name identifying the field
- newvalue - New DataFieldValue value for the field
- Returns:
- null if new field created, old data field value if field existed before
All Packages Class Hierarchy This Package Previous Next Index