T
- the value typepublic interface TimeIndexable<T> extends TimeAddressable<T>
TimeAddressable
where the range size can be
stored in a 32 bit integer, and with a value for all time units in the
range. The values are either actual values or missing values.
The restriction on the range size makes it possible to store values in
structures indexed by 32 bit integers.
A TimeIndexable places restrictions on the length of a single run of missing
values. Any of the put
methods can throw an exception
when a certain threshold is exceeded. The threshold can be queried with
getMaxGap()
. The maximum allowed gap can be modified for an
application by setting the system property RegularTimeSeries.MAXGAP_PROPERTY
.
The definitions of copy()
and makeEmptyCopy()
are
overridden to return a TimeIndexable
instead of a TimeAddressable
.
Modifier and Type | Method and Description |
---|---|
TimeIndexable<T> |
copy()
Return a copy of the time series.
|
int |
fill(Filler<T> filler)
Fill holes using the given procedure.
|
int |
fill(long tailLength)
Fill holes in the time series by repeating the last value before each
hole and append a tail by repeating the last value a given number of
times.
|
int |
fill(T replacement,
long tailLength)
Fill holes in the time series with the given value and append a
tail of the given length.
|
T[] |
getArray()
Return all the values in an array.
|
T[] |
getArray(Range range)
Return a subrange of values in an array.
|
int |
getMaxGap()
Return the maximum allowed length of a single run of missing values.
|
Iterator<Observation<T>> |
iterator()
Returns an iterator over the
Observation s in the time series
ordered by increasing time index. |
TimeIndexable<T> |
makeEmptyCopy()
Make a copy of the time series but without the values.
|
asIndexable, get, get, get, get, getFirst, getFirstIndex, getLast, getLastIndex, getMissingValue, getRange, getSize, getTimeDomain, getType, getValueCount, isIndexable, isMissing, put, put, put, put, put, remove, setRange
forEach, spliterator
Iterator<Observation<T>> iterator()
Observation
s in the time series
ordered by increasing time index. In contrast to
TimeAddressable.iterator()
, this iterator returns all missing
valuesiterator
in interface Iterable<Observation<T>>
iterator
in interface TimeAddressable<T>
int getMaxGap()
T[] getArray()
T[] getArray(Range range) throws T2Exception
range
- the non-null wanted rangeT2Exception
int fill(T replacement, long tailLength) throws T2Exception
Note: the method can be used to count missing values by specify a missing value as replacement. In this case it is illegal to specify a positive tail length.
replacement
- the replacement valuetailLength
- the length of the tail to appendT2Exception
int fill(long tailLength)
tailLength
- the number of times the last value must be repeatedint fill(Filler<T> filler) throws T2Exception
filler
- a non-null fillerT2Exception
TimeIndexable<T> copy() throws T2Exception
TimeAddressable
copy
in interface TimeAddressable<T>
T2Exception
TimeIndexable<T> makeEmptyCopy()
TimeAddressable
makeEmptyCopy
in interface TimeAddressable<T>
Copyright © 2017. All rights reserved.