Package edu.ie3.datamodel.io.source.csv
Class CsvTimeSeriesSource<V extends Value>
java.lang.Object
edu.ie3.datamodel.io.source.csv.CsvDataSource
edu.ie3.datamodel.io.source.csv.CsvTimeSeriesSource<V>
- All Implemented Interfaces:
DataSource
,TimeSeriesSource<V>
public class CsvTimeSeriesSource<V extends Value>
extends CsvDataSource
implements TimeSeriesSource<V>
Source that is capable of providing information around time series from csv files.
-
Field Summary
Fields inherited from class edu.ie3.datamodel.io.source.csv.CsvDataSource
connector, csvSep, FIELDS_TO_VALUES_MAP, log, NODE, NODE_A, NODE_B, OPERATOR, TYPE
-
Constructor Summary
ConstructorDescriptionCsvTimeSeriesSource
(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy, UUID timeSeriesUuid, String filePath, Class<V> valueClass, TimeBasedSimpleValueFactory<V> factory) Initializes a new CsvTimeSeriesSource -
Method Summary
Modifier and TypeMethodDescriptionstatic CsvTimeSeriesSource<? extends Value>
getSource
(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy, CsvFileConnector.CsvIndividualTimeSeriesMetaInformation metaInformation) Deprecated, for removal: This API element is subject to removal in a future version.since 3.0.static CsvTimeSeriesSource<? extends Value>
getSource
(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy, CsvIndividualTimeSeriesMetaInformation metaInformation) Factory method to build a source from given meta informationObtain the full time seriesgetTimeSeries
(edu.ie3.util.interval.ClosedInterval<ZonedDateTime> timeInterval) Get the time series for the given time interval.getValue
(ZonedDateTime time) Get the time series value for a specific timeMethods inherited from class edu.ie3.datamodel.io.source.csv.CsvDataSource
assetInputEntityDataStream, assetInputEntityDataStream, buildStreamWithFieldsToAttributesMap, buildStreamWithFieldsToAttributesMap, csvRowFieldValueMapping, distinctRowsWithLog, findFirstEntityByUuid, getAssetType, isPresentCollectIfNot, logSkippingWarning, nodeAssetEntityStream, nodeAssetInputEntityDataStream, parseCsvRow, printInvalidElementInformation, saveMapGet, simpleEntityDataStream
-
Constructor Details
-
CsvTimeSeriesSource
public CsvTimeSeriesSource(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy, UUID timeSeriesUuid, String filePath, Class<V> valueClass, TimeBasedSimpleValueFactory<V> factory) Initializes a new CsvTimeSeriesSource- Parameters:
csvSep
- the separator string for csv columnsfolderPath
- path to the folder holding the time series filesfileNamingStrategy
- strategy for the file naming of time series files / data sinkstimeSeriesUuid
- Unique identifier of the time seriesfilePath
- Path of the file, excluding extension and being relative tofolderPath
valueClass
- Class of the valuefactory
- The factory implementation to use for actual parsing of input data
-
-
Method Details
-
getSource
@Deprecated(since="3.0", forRemoval=true) public static CsvTimeSeriesSource<? extends Value> getSource(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy, CsvFileConnector.CsvIndividualTimeSeriesMetaInformation metaInformation) throws SourceException Deprecated, for removal: This API element is subject to removal in a future version.Factory method to build a source from given meta information- Parameters:
csvSep
- the separator string for csv columnsfolderPath
- path to the folder holding the time series filesfileNamingStrategy
- strategy for the file naming of time series files / data sinksmetaInformation
- The given meta information- Returns:
- The source
- Throws:
SourceException
- If the given meta information are not supported
-
getSource
public static CsvTimeSeriesSource<? extends Value> getSource(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy, CsvIndividualTimeSeriesMetaInformation metaInformation) throws SourceException Factory method to build a source from given meta information- Parameters:
csvSep
- the separator string for csv columnsfolderPath
- path to the folder holding the time series filesfileNamingStrategy
- strategy for the file naming of time series files / data sinksmetaInformation
- The given meta information- Returns:
- The source
- Throws:
SourceException
- If the given meta information are not supported
-
getTimeSeries
Description copied from interface:TimeSeriesSource
Obtain the full time series- Specified by:
getTimeSeries
in interfaceTimeSeriesSource<V extends Value>
- Returns:
- the time series
-
getTimeSeries
public IndividualTimeSeries<V> getTimeSeries(edu.ie3.util.interval.ClosedInterval<ZonedDateTime> timeInterval) Description copied from interface:TimeSeriesSource
Get the time series for the given time interval. If the interval is bigger than the time series itself, only the parts of the time series within the interval are handed back.- Specified by:
getTimeSeries
in interfaceTimeSeriesSource<V extends Value>
- Parameters:
timeInterval
- Desired time interval to cover- Returns:
- The parts of of interest of the time series
-
getValue
Description copied from interface:TimeSeriesSource
Get the time series value for a specific time- Specified by:
getValue
in interfaceTimeSeriesSource<V extends Value>
- Parameters:
time
- The queried time- Returns:
- Option on a value for that time
-