DATA
- TS
- public abstract class ConcreteTimeSeries<DATA,TS extends ConcreteTimeSeries<DATA,TS>> extends TimeSeries<DATA[],DATA,TS> implements TimeSeriesCollectionAssignable<DATA,TS>
ReflectionUtils.getTypeArguments(Class, Class)
. To
use this class simple define a new classConstructor and Description |
---|
ConcreteTimeSeries()
Initialise the backing treemap
|
Modifier and Type | Method and Description |
---|---|
void |
add(long time,
DATA value)
Add an element to this time series
|
TS |
get(long time,
int nbefore,
int nafter)
returns the DATA at a specific point in time and those before and after
to the number requested.
|
TS |
get(long time,
int nbefore,
int nafter,
TS output)
Same as
TimeSeries.get(long, int, int) but instead of createing the output
DATA instance, an existing data instance is handed which is filled. |
TS |
get(long start,
long end)
returns the RETURNTYPE between the specified time periods.
|
TS |
get(long time,
long threshbefore,
long threshafter)
returns the RETURNTYPE at a specific point in time and those before and
after within the specified thresholds.
|
DATA[] |
getData() |
long[] |
getTimes() |
void |
internalAssign(Collection<Long> times,
Collection<DATA> data)
Assign these values of data and time to the internal collection
|
void |
internalAssign(long[] times,
DATA[] data) |
void |
internalAssign(TS assign) |
Iterator<IndependentPair<Long,DATA>> |
iterator() |
TS |
newInstance(Collection<Long> timeList,
Collection<DATA> dataList) |
void |
set(long[] time,
DATA[] data)
Set the data associated with each time.
|
int |
size() |
String |
toString() |
convert, convert, copy, get, newInstance, process, processInplace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ConcreteTimeSeries()
public TS get(long time, int nbefore, int nafter)
TimeSeries
Data should be returned in order
get
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public TS newInstance(Collection<Long> timeList, Collection<DATA> dataList)
newInstance
in interface TimeSeriesCollectionAssignable<DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public TS get(long time, int nbefore, int nafter, TS output)
TimeSeries
TimeSeries.get(long, int, int)
but instead of createing the output
DATA instance, an existing data instance is handed which is filled. For
convenience this output is also returned
Data should be returned in order
get
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public TS get(long time, long threshbefore, long threshafter)
TimeSeries
Data should be returned in order
get
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public TS get(long start, long end)
TimeSeries
Data should be returned in order
get
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public void add(long time, DATA value)
time
- value
- public void set(long[] time, DATA[] data)
TimeSeries
set
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
time
- instances of timedata
- instances of datapublic long[] getTimes()
getTimes
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public DATA[] getData()
getData
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public int size()
size
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public void internalAssign(TS assign)
internalAssign
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
assign
- assign this timeseries to the internal one, efforts should be
made to copy the data, not simply assign itpublic void internalAssign(long[] times, DATA[] data)
internalAssign
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public void internalAssign(Collection<Long> times, Collection<DATA> data)
TimeSeriesCollectionAssignable
internalAssign
in interface TimeSeriesCollectionAssignable<DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public String toString()
toString
in class TimeSeries<DATA[],DATA,TS extends ConcreteTimeSeries<DATA,TS>>
public Iterator<IndependentPair<Long,DATA>> iterator()
iterator
in interface Iterable<IndependentPair<Long,DATA>>