Class SparkTimeseriesDataSet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<TimeseriesData>
-
- cern.nxcals.api.backport.domain.core.timeseriesdata.SparkTimeseriesDataSet
-
- All Implemented Interfaces:
TimeseriesDataSet,java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<TimeseriesData>,java.util.Collection<TimeseriesData>,java.util.List<TimeseriesData>,java.util.RandomAccess
public class SparkTimeseriesDataSet extends java.util.ArrayList<TimeseriesData> implements TimeseriesDataSet
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(TimeseriesData data)Deprecated.(never use, major performance hit, could have led to unpredictable states)booleanaddAll(java.util.Collection<? extends TimeseriesData> c)Deprecated.(never use, major performance hit, could have led to unpredictable states)voidaddTimeseriesData(TimeseriesData data)Deprecated.(never use, major performance hit, could have led to unpredictable states)TimeseriesDataSetalignToTimestamps(TimeseriesDataSet required)voidappend(TimeseriesDataSet data)Deprecated.(never use, major performance hit, could have led to unpredictable states)protected booleancanEqual(java.lang.Object other)voidclear()Deprecated.(never use, major performance hit, could have led to unpredictable states)booleanequals(java.lang.Object o)java.sql.TimestampgetMaxStamp()TimeseriesDataSetMetaDatagetMetaData()java.lang.StringgetMetaDataInfo(LoggingTimeZone timeZone)java.sql.TimestampgetMinStamp()TimeseriesDatagetTimeseriesData(int index)TimeseriesDatagetTimeseriesData(java.sql.Timestamp timestamp)Returns the data at the given timestamp or null if the data is not foundTimeseriesDatagetTimeseriesDataOrLast(java.sql.Timestamp timestamp)Returns the data at the given timestamp or repeat the last value if there is no value found at the given timestamp If there is no value before that time, null is returnedjava.lang.StringgetUnit()VariablegetVariable()Note: Not always available (depending on the extraction)VariableDataTypegetVariableDataType()java.lang.StringgetVariableName()inthashCode()static TimeseriesDataSetof(Variable variable, java.util.List<TimeseriesData> data)static TimeseriesDataSetof(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)static TimeseriesDataSetofAggregated(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)static TimeseriesDataSetofDataDistribution(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)static TimeseriesDataSetofFundamentals(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)static TimeseriesDataSetofSorted(Variable variable, java.util.List<TimeseriesData> data)static TimeseriesDataSetofSorted(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)voidprint(LoggingTimeZone utcTime)Deprecated.(never use, antipattern)booleanremove(java.lang.Object o)Deprecated.(never use, major performance hit, could have led to unpredictable states)booleanremoveAll(java.util.Collection<?> c)Deprecated.(never use, major performance hit, could have led to unpredictable states)booleanretainAll(java.util.Collection<?> c)Deprecated.(never use, major performance hit, could have led to unpredictable states)-
Methods inherited from class java.util.ArrayList
add, addAll, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeIf, removeRange, replaceAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cern.nxcals.api.backport.domain.core.timeseriesdata.TimeseriesDataSet
listIterator
-
-
-
-
Method Detail
-
of
public static TimeseriesDataSet of(Variable variable, java.util.List<TimeseriesData> data)
-
ofSorted
public static TimeseriesDataSet ofSorted(Variable variable, java.util.List<TimeseriesData> data)
-
of
public static TimeseriesDataSet of(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
ofFundamentals
public static TimeseriesDataSet ofFundamentals(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
ofDataDistribution
public static TimeseriesDataSet ofDataDistribution(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
ofSorted
public static TimeseriesDataSet ofSorted(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
ofAggregated
public static TimeseriesDataSet ofAggregated(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
getTimeseriesData
public TimeseriesData getTimeseriesData(int index)
- Specified by:
getTimeseriesDatain interfaceTimeseriesDataSet- Parameters:
index- - the index in this TimeseriesDataSet for which TimeseriesData should be returned.- Returns:
- - TimeseriesData at the given index within this TimeseriesDataSet
-
getVariableName
public java.lang.String getVariableName()
- Specified by:
getVariableNamein interfaceTimeseriesDataSet- Returns:
- - the name of the Variable to which this TimeseriesData belongs
-
getUnit
public java.lang.String getUnit()
- Specified by:
getUnitin interfaceTimeseriesDataSet
-
getVariableDataType
public VariableDataType getVariableDataType()
- Specified by:
getVariableDataTypein interfaceTimeseriesDataSet- Returns:
- - the type of the Variable to which this TimeseriesData belongs
-
getTimeseriesDataOrLast
public TimeseriesData getTimeseriesDataOrLast(java.sql.Timestamp timestamp)
Description copied from interface:TimeseriesDataSetReturns the data at the given timestamp or repeat the last value if there is no value found at the given timestamp If there is no value before that time, null is returned- Specified by:
getTimeseriesDataOrLastin interfaceTimeseriesDataSet- Parameters:
timestamp- - The given timestamp- Returns:
- - The data at the given timestamp or just before
-
getTimeseriesData
public TimeseriesData getTimeseriesData(java.sql.Timestamp timestamp)
Description copied from interface:TimeseriesDataSetReturns the data at the given timestamp or null if the data is not found- Specified by:
getTimeseriesDatain interfaceTimeseriesDataSet- Returns:
-
getMetaDataInfo
public java.lang.String getMetaDataInfo(LoggingTimeZone timeZone)
- Specified by:
getMetaDataInfoin interfaceTimeseriesDataSet
-
getMetaData
public TimeseriesDataSetMetaData getMetaData()
- Specified by:
getMetaDatain interfaceTimeseriesDataSet
-
alignToTimestamps
public TimeseriesDataSet alignToTimestamps(TimeseriesDataSet required)
- Specified by:
alignToTimestampsin interfaceTimeseriesDataSet
-
print
@Deprecated public void print(LoggingTimeZone utcTime)
Deprecated.(never use, antipattern)- Specified by:
printin interfaceTimeseriesDataSet
-
addTimeseriesData
@Deprecated public void addTimeseriesData(TimeseriesData data)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
addTimeseriesDatain interfaceTimeseriesDataSet- Parameters:
data- - the TimeseriesData to be added to this TimeseriesDataSet
-
append
@Deprecated public void append(TimeseriesDataSet data)
Deprecated.(never use, major performance hit, could have led to unpredictable states)Description copied from interface:TimeseriesDataSetAppends a Timeseries Data Set to the end of the current data set- Specified by:
appendin interfaceTimeseriesDataSet- Parameters:
data- The data set to be appended
-
add
@Deprecated public boolean add(TimeseriesData data)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
addin interfacejava.util.Collection<TimeseriesData>- Specified by:
addin interfacejava.util.List<TimeseriesData>- Overrides:
addin classjava.util.ArrayList<TimeseriesData>
-
remove
@Deprecated public boolean remove(java.lang.Object o)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
removein interfacejava.util.Collection<TimeseriesData>- Specified by:
removein interfacejava.util.List<TimeseriesData>- Overrides:
removein classjava.util.ArrayList<TimeseriesData>
-
addAll
@Deprecated public boolean addAll(java.util.Collection<? extends TimeseriesData> c)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
addAllin interfacejava.util.Collection<TimeseriesData>- Specified by:
addAllin interfacejava.util.List<TimeseriesData>- Overrides:
addAllin classjava.util.ArrayList<TimeseriesData>
-
removeAll
@Deprecated public boolean removeAll(java.util.Collection<?> c)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
removeAllin interfacejava.util.Collection<TimeseriesData>- Specified by:
removeAllin interfacejava.util.List<TimeseriesData>- Overrides:
removeAllin classjava.util.ArrayList<TimeseriesData>
-
retainAll
@Deprecated public boolean retainAll(java.util.Collection<?> c)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
retainAllin interfacejava.util.Collection<TimeseriesData>- Specified by:
retainAllin interfacejava.util.List<TimeseriesData>- Overrides:
retainAllin classjava.util.ArrayList<TimeseriesData>
-
clear
@Deprecated public void clear()
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
clearin interfacejava.util.Collection<TimeseriesData>- Specified by:
clearin interfacejava.util.List<TimeseriesData>- Overrides:
clearin classjava.util.ArrayList<TimeseriesData>
-
getVariable
public Variable getVariable()
Description copied from interface:TimeseriesDataSetNote: Not always available (depending on the extraction)- Specified by:
getVariablein interfaceTimeseriesDataSet- Returns:
-
getMinStamp
public java.sql.Timestamp getMinStamp()
- Specified by:
getMinStampin interfaceTimeseriesDataSet- Returns:
- - the smallest timestamp in the timeseries data set
-
getMaxStamp
public java.sql.Timestamp getMaxStamp()
- Specified by:
getMaxStampin interfaceTimeseriesDataSet- Returns:
- - the highest timestamp in the timeseries data set.
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Collection<TimeseriesData>- Specified by:
equalsin interfacejava.util.List<TimeseriesData>- Overrides:
equalsin classjava.util.ArrayList<TimeseriesData>
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Collection<TimeseriesData>- Specified by:
hashCodein interfacejava.util.List<TimeseriesData>- Overrides:
hashCodein classjava.util.ArrayList<TimeseriesData>
-
-