public class CsvFileAdapter extends DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>
DataAdapter implementation used to Worksheet instances
with data from a local CSV formatted file.closed| Constructor and Description |
|---|
CsvFileAdapter()
Initializes a new instance of the
CsvFileAdapter class with a set of default values. |
CsvFileAdapter(java.lang.String csvPath,
java.time.ZoneId zoneId)
Initializes a new instance of the
CsvFileAdapter class for the provided file and time zone. |
CsvFileAdapter(java.lang.String csvPath,
java.time.ZoneId zoneId,
java.lang.String encoding,
java.lang.String dateTimePattern,
char delimiter)
Initializes a new instance of the
CsvFileAdapter class with the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
java.util.Map<TimeSeriesInfo<java.lang.Double>,TimeSeriesProcessor<java.lang.Double>> |
fetchDecodedData(java.lang.String path,
java.time.Instant begin,
java.time.Instant end,
java.util.List<TimeSeriesInfo<java.lang.Double>> seriesInfo,
boolean bypassCache)
Gets decoded data from the source as a map of
TimeSeriesProcessor, for the time interval and TimeSeriesInfo specified. |
java.io.InputStream |
fetchRawData(java.lang.String path,
java.time.Instant begin,
java.time.Instant end,
boolean bypassCache)
Gets raw data from the source as an output stream, for the time interval specified.
|
javafx.scene.control.TreeItem<TimeSeriesBinding<java.lang.Double>> |
getBindingTree()
Return a hierarchical view of all the individual bindings exposed by the underlying source.
|
protected java.util.SortedMap<java.lang.Long,DataSample<java.lang.Double>> |
getDataStore() |
CsvDecoder<java.lang.Double> |
getDecoder()
Gets the
Decoder used to produce TimeSeriesProcessor from the source. |
java.lang.String |
getEncoding()
Gets the encoding used to decode textual data sent by the source.
|
java.util.Map<java.lang.String,java.lang.String> |
getParams()
Returns a map of all parameters required to establish a connection to the underlying data source
|
java.lang.String |
getSourceName()
Gets the name of the source.
|
java.time.ZoneId |
getTimeZoneId()
Gets the id of the time zone used to record dates in the source.
|
void |
loadParams(java.util.Map<java.lang.String,java.lang.String> params)
Sets the parameters required to establish a connection to the underlying data source
|
boolean |
ping()
Pings the data source
|
getId, isClosed, onStart, setId, toString, validateParameter, validateParameterNullitypublic CsvFileAdapter()
throws DataAdapterException
CsvFileAdapter class with a set of default values.DataAdapterException - if the DataAdapter could not be initializes.public CsvFileAdapter(java.lang.String csvPath,
java.time.ZoneId zoneId)
throws DataAdapterException
CsvFileAdapter class for the provided file and time zone.csvPath - the path to the csv file.zoneId - the time zone to used.DataAdapterException - if the DataAdapter could not be initializes.public CsvFileAdapter(java.lang.String csvPath,
java.time.ZoneId zoneId,
java.lang.String encoding,
java.lang.String dateTimePattern,
char delimiter)
throws DataAdapterException
CsvFileAdapter class with the provided parameters.csvPath - the path to the csv file.zoneId - the time zone to used.encoding - the encoding for the csv file.dateTimePattern - a pattern to decode time stamps.delimiter - the character used by the csv file to separate cells in csv records.DataAdapterException - if the DataAdapter could not be initializes.public javafx.scene.control.TreeItem<TimeSeriesBinding<java.lang.Double>> getBindingTree() throws DataAdapterException
DataAdaptergetBindingTree in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>DataAdapterException - if an error occurs while retrieving bindings.public java.util.Map<TimeSeriesInfo<java.lang.Double>,TimeSeriesProcessor<java.lang.Double>> fetchDecodedData(java.lang.String path, java.time.Instant begin, java.time.Instant end, java.util.List<TimeSeriesInfo<java.lang.Double>> seriesInfo, boolean bypassCache) throws DataAdapterException
DataAdapterTimeSeriesProcessor, for the time interval and TimeSeriesInfo specified.fetchDecodedData in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>path - the path of the data in the sourcebegin - the start of the time interval.end - the end of the time interval.seriesInfo - the series to get data from.bypassCache - true if adapter cache should be bypassed, false otherwise. This parameter is ignored if adapter does not support cachingDataAdapterException - if an error occurs while retrieving data from the source.public java.io.InputStream fetchRawData(java.lang.String path,
java.time.Instant begin,
java.time.Instant end,
boolean bypassCache)
throws DataAdapterException
DataAdapterfetchRawData in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>path - the path of the data in the sourcebegin - the start of the time interval.end - the end of the time interval.*bypassCache - true if adapter cache should be bypassed, false otherwise. This parameter is ignored if adapter does not support cachingDataAdapterException - if an error occurs while retrieving data from the source.public java.lang.String getEncoding()
DataAdaptergetEncoding in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>public java.time.ZoneId getTimeZoneId()
DataAdaptergetTimeZoneId in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>public CsvDecoder<java.lang.Double> getDecoder()
DataAdapterDecoder used to produce TimeSeriesProcessor from the source.getDecoder in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>Decoder used to produce TimeSeriesProcessor from the source.public java.lang.String getSourceName()
DataAdaptergetSourceName in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>public java.util.Map<java.lang.String,java.lang.String> getParams()
DataAdaptergetParams in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>public void loadParams(java.util.Map<java.lang.String,java.lang.String> params)
throws DataAdapterException
DataAdapterloadParams in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>params - the parameters required to establish a connection to the underlying data sourceDataAdapterExceptionpublic boolean ping()
DataAdapterping in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>public void close()
close in interface java.lang.AutoCloseableclose in class DataAdapter<java.lang.Double,CsvDecoder<java.lang.Double>>protected java.util.SortedMap<java.lang.Long,DataSample<java.lang.Double>> getDataStore() throws DataAdapterException
DataAdapterExceptionCopyright © 2018 Frederic Thevenet. All rights reserved.