|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.io.TSGaussFMTHandler
public final class TSGaussFMTHandler
Class for importing files from Gauss .fmt
files. There are 4
supported formats, see the Gauss reference manual for a specification of the
binary formats:
Version v96 is also supported for exporting data via a static method.
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 an instance of TSImportTypes . |
static TSGaussFMTHandler |
getInstance()
Gets the singleton instance of this handler. |
static java.lang.String[] |
getNamesArray(java.io.File fName,
int cols,
java.lang.String namesFromDialog)
Helper method to get an array of valid variable names. |
boolean |
importData(java.io.File file)
Initiates parsing of .fmt Gauss matrix file. |
void |
setTestMode(boolean noDialog)
Sets this handler in test mode. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static TSGaussFMTHandler getInstance()
public static java.lang.String[] getNamesArray(java.io.File fName, int cols, java.lang.String namesFromDialog)
fName
- filename of the file to be read incols
- number of columns with numerical datanamesFromDialog
- string with space separated names, typically from a dialog,
for example "a b c d"
fName
and an index or from
namesFromDialog
public boolean importData(java.io.File file)
importData
in interface DataHandler
file
- the file to read in
true
of import was ok, false
if
cancelled or erroneous
java.lang.IllegalArgumentException
- if (file == null || !file.isFile())
java.lang.RuntimeException
- when file reading failspublic JSCData getData(ImportTypes type)
TSImportTypes
.
getData
in interface DataHandler
type
- the elementtype of a time series dataset
JSCData
java.lang.IllegalArgumentException
- if (type == null)
java.lang.IllegalStateException
- if nothing was imported beforepublic void exportTS(java.io.File file, TS[] ts, java.lang.String description)
DataHandler
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.
exportTS
in interface DataHandler
file
- the file to store the time series tots
- array of time series to exportdescription
- an optional dataset description that handler implementations
might usepublic void exportData(java.io.File file, JSCData data, java.lang.String description)
DataHandler
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.
exportData
in interface DataHandler
file
- the file to store the data todata
- the data object to store, must be supporteddescription
- an optional description that handler implementations might usepublic void setTestMode(boolean noDialog)
noDialog
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |