|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataHandler
Interface to be implemented by classes that initiate parsing of data files
and the creation of datasets. It can be used to import all kinds of datasets,
because it does not rely on a distinct dataset class. It only uses the
convention that elements of the dataset are stored as JSCData
objects and that there exist ImportTypes
defining the
structure of a dataset.
The implementations of DataHandler
should check whether a
created dataset is in a consistent state when it can be accessed via
getData
.
Method Summary | |
---|---|
void |
exportData(java.io.File file,
JSCData data,
java.lang.String description)
Exports data to a file in the format that the respective implementation of this interface handles. |
void |
exportTS(java.io.File file,
TS[] ts,
java.lang.String description)
Exports time series to a file in the format that the respective implementation of this interface handles. |
JSCData |
getData(ImportTypes type)
Gets the imported data according to the respective type, which defines the kind of information to retrieve from the imported dataset. |
boolean |
importData(java.io.File file)
Parses file and collects the data as JSCData
objects in a SymbolTable . |
Method Detail |
---|
boolean importData(java.io.File file)
file
and collects the data as JSCData
objects in a SymbolTable
. In case of an error this method
should throw an exception. The return parameter should only indicate that
the import operation was cancelled.
file
- the file containing the data
true
of import was ok, false
if
cancelledJSCData getData(ImportTypes type)
type
- defines the element of the dataset to get, for example the
start date
JSCData
void exportTS(java.io.File file, TS[] ts, java.lang.String description)
Implementation Note:
Not every handler implementation uses all information contained in a time
series. For example, some handlers might not store the variable names,
the date, and the description, because this may not be supported by the
respective format.
Implementations of this method should throw unchecked exceptions in case of errors, which should be dealt with by the calling objects.
file
- the file to store the time series tots
- array of time series to exportdescription
- an optional dataset description that handler implementations
might usevoid exportData(java.io.File file, JSCData data, java.lang.String description)
data
is not suppported.
Implementations of this method should throw unchecked exceptions in case of errors, which should be dealt with by the calling objects.
file
- the file to store the data todata
- the data object to store, must be supporteddescription
- an optional description that handler implementations might use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |