public class DoubleTimeSeries extends TimeSeries<double[],Double,DoubleTimeSeries> implements TimeSeriesArithmaticOperator<Double,DoubleTimeSeries>, ReadWriteableASCII, TimeSeriesCollectionAssignable<Double,DoubleTimeSeries>, DoubleTimeSeriesProvider
Constructor and Description |
---|
DoubleTimeSeries()
Sets the times and data arrays backing this class 0 length
|
DoubleTimeSeries(int i)
Convenience constructor, makes a time series with empty data of a given size
|
DoubleTimeSeries(long[] times,
double[] data) |
Modifier and Type | Method and Description |
---|---|
String |
asciiHeader()
Header for ascii input.
|
DoubleTimeSeries |
doubleTimeSeries() |
DoubleTimeSeries |
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.
|
DoubleTimeSeries |
get(long time,
int nbefore,
int nafter,
DoubleTimeSeries 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. |
DoubleTimeSeries |
get(long start,
long end)
returns the RETURNTYPE between the specified time periods.
|
DoubleTimeSeries |
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.
|
double[] |
getData() |
long[] |
getTimes() |
void |
internalAssign(Collection<Long> time,
Collection<Double> data)
Assign these values of data and time to the internal collection
|
void |
internalAssign(DoubleTimeSeries interpolate) |
void |
internalAssign(long[] times,
double[] data) |
Iterator<IndependentPair<Long,Double>> |
iterator() |
DoubleTimeSeries |
newInstance() |
DoubleTimeSeries |
newInstance(Collection<Long> time,
Collection<Double> data) |
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
set(long[] times,
double[] data)
Set the data associated with each time.
|
int |
size() |
Double |
sum()
add together all time series data elements
|
String |
toString() |
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
Double |
zero() |
convert, convert, copy, get, process, processInplace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public DoubleTimeSeries(int i)
i
- public DoubleTimeSeries()
public DoubleTimeSeries(long[] times, double[] data)
times
- data
- public DoubleTimeSeries get(long time, int nbefore, int nafter)
TimeSeries
Data should be returned in order
get
in class TimeSeries<double[],Double,DoubleTimeSeries>
public DoubleTimeSeries get(long time, int nbefore, int nafter, DoubleTimeSeries 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<double[],Double,DoubleTimeSeries>
public DoubleTimeSeries get(long time, long threshbefore, long threshafter)
TimeSeries
Data should be returned in order
get
in class TimeSeries<double[],Double,DoubleTimeSeries>
public DoubleTimeSeries get(long start, long end)
TimeSeries
Data should be returned in order
get
in class TimeSeries<double[],Double,DoubleTimeSeries>
public void set(long[] times, double[] data)
TimeSeries
set
in class TimeSeries<double[],Double,DoubleTimeSeries>
times
- instances of timedata
- instances of datapublic long[] getTimes()
getTimes
in class TimeSeries<double[],Double,DoubleTimeSeries>
public double[] getData()
getData
in class TimeSeries<double[],Double,DoubleTimeSeries>
public DoubleTimeSeries newInstance()
newInstance
in class TimeSeries<double[],Double,DoubleTimeSeries>
public int size()
size
in class TimeSeries<double[],Double,DoubleTimeSeries>
public void internalAssign(DoubleTimeSeries interpolate)
internalAssign
in class TimeSeries<double[],Double,DoubleTimeSeries>
interpolate
- assign this timeseries to the internal one, efforts should be
made to copy the data, not simply assign itpublic String toString()
toString
in class TimeSeries<double[],Double,DoubleTimeSeries>
public Iterator<IndependentPair<Long,Double>> iterator()
iterator
in interface Iterable<IndependentPair<Long,Double>>
public void readASCII(Scanner in) throws IOException
ReadableASCII
readASCII
in interface ReadableASCII
in
- source to read from.IOException
- an error reading inputpublic String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
public void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
out
- sink to write toIOException
- an error writing to outpublic DoubleTimeSeries newInstance(Collection<Long> time, Collection<Double> data)
newInstance
in interface TimeSeriesCollectionAssignable<Double,DoubleTimeSeries>
public void internalAssign(Collection<Long> time, Collection<Double> data)
TimeSeriesCollectionAssignable
internalAssign
in interface TimeSeriesCollectionAssignable<Double,DoubleTimeSeries>
public void internalAssign(long[] times, double[] data)
internalAssign
in class TimeSeries<double[],Double,DoubleTimeSeries>
public Double zero()
zero
in interface TimeSeriesArithmaticOperator<Double,DoubleTimeSeries>
public Double sum()
TimeSeriesArithmaticOperator
sum
in interface TimeSeriesArithmaticOperator<Double,DoubleTimeSeries>
public DoubleTimeSeries doubleTimeSeries()
doubleTimeSeries
in interface DoubleTimeSeriesProvider