T - the timestamp typepublic class GenericTimeTimeSeries<T extends java.lang.Comparable<? super T>> extends java.lang.Object implements TimeSeries<T,TimeSeries.Entry<T>>
TimeSeries.Entry<T>| Constructor and Description |
|---|
GenericTimeTimeSeries(T[] timestamps,
double[] values)
Construct a univariate time series from timestamps and values.
|
| Modifier and Type | Method and Description |
|---|---|
GenericTimeTimeSeries<T> |
diff(int d)
Construct an instance of
GenericTimeTimeSeries by taking the first difference d times. |
GenericTimeTimeSeries<T> |
drop(int nItems)
Construct an instance of
GenericTimeTimeSeries by dropping the leading nItems entries. |
boolean |
equals(java.lang.Object obj) |
double |
get(int i)
Get the i-th value.
|
double |
get(T t)
Get the value at time
t. |
int |
hashCode() |
java.util.Iterator<TimeSeries.Entry<T>> |
iterator() |
int |
size()
Get the length of the time series.
|
T |
time(int index)
Get the i-th time.
|
T[] |
timestamps()
Get all the timestamps.
|
double[] |
toArray()
Convert this time series into an array, discarding the timestamps.
|
java.lang.String |
toString() |
public GenericTimeTimeSeries(T[] timestamps, double[] values)
timestamps - the timestampsvalues - the valuespublic int size()
TimeSeriessize in interface TimeSeries<T extends java.lang.Comparable<? super T>,java.lang.Double,TimeSeries.Entry<T extends java.lang.Comparable<? super T>>>public java.util.Iterator<TimeSeries.Entry<T>> iterator()
iterator in interface java.lang.Iterable<TimeSeries.Entry<T extends java.lang.Comparable<? super T>>>public double[] toArray()
TimeSeriespublic double get(int i)
i - the position indexpublic double get(T t)
t.t - a timestamptpublic T time(int index)
index - the position indexpublic T[] timestamps()
public GenericTimeTimeSeries<T> drop(int nItems)
GenericTimeTimeSeries by dropping the leading nItems entries.nItems - the number of leading entries to be droppedGenericTimeTimeSeriespublic GenericTimeTimeSeries<T> diff(int d)
GenericTimeTimeSeries by taking the first difference d times.d - the number of differencesdiff(x, lag = 1, differences = d) as in Rpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object