T - public class SparseTimeSeries<T> extends AbstractTimeSeries<T> implements TimeAddressable<T>
TimeAddressable. Missing values are never
stored in a sparse time series, but nulls can be stored, unless they are used
for representing missing values.
This implementation provides no synchronization.
| Modifier and Type | Class and Description |
|---|---|
class |
SparseTimeSeries.IrregularTimeSeriesIterator
IrregularTimeSeriesIterator is an
Iterator returning
Observation objects. |
| Constructor and Description |
|---|
SparseTimeSeries(Class<T> type,
TimeDomain domain)
Construct a sparse time series with the given type and time domain.
|
SparseTimeSeries(Class<T> type,
TimeDomain domain,
T missingValue)
Construct a sparse time series with the given type, time domain and missing
value.
|
| Modifier and Type | Method and Description |
|---|---|
TimeIndexable<T> |
asIndexable()
Return an indexable time series corresponding to this one.
|
TimeAddressable<T> |
get(long first,
long last)
Return a new time series corresponding to the range between two numerical time indexes.
|
TimeAddressable<T> |
get(Range range)
Return a time series constructed from the given range of this series.
|
int |
getValueCount()
Return the number of non-missing values.
|
protected void |
internalClear()
Remove all values from the time series.
|
protected T |
internalGet(long index)
Get the value identified by the given numerical time index.
|
protected Collection<T> |
internalGetData()
Return all values as a
Collection. |
protected Observation<T> |
internalGetFirst(long index)
Return the observation at or after the given numerical time index.
|
protected long |
internalGetFirstIndex()
Return the numerical time index of the first element.
|
protected Observation<T> |
internalGetLast(long index)
Return the observation at or before the given numerical time index.
|
protected long |
internalGetLastIndex()
Return the numerical time index of the last element.
|
protected int |
internalGetSize()
Return the used size of the data structure where values are stored.
|
protected void |
internalPut(long index,
T value)
Put the value into the series at the given numerical time index.
|
protected void |
internalRemove(long index)
Remove the value at the given numerical time index.
|
protected void |
internalSetBounds(long first,
long last)
Shrink the range to the one given by the two numerical time indexes.
|
boolean |
isIndexable()
Return true if the time series implements
TimeIndexable. |
Iterator<Observation<T>> |
iterator()
Returns an iterator over the
Observations in the time series
ordered by increasing time index. |
TimeAddressable<T> |
makeEmptyCopy()
Make a copy of the time series but without the values.
|
accept, copy, get, get, getFirst, getFirstIndex, getLast, getLastIndex, getMissingValue, getRange, getSize, getTimeDomain, getType, isMissing, make, normalizeMissingValue, put, put, put, put, put, remove, setRange, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcopy, get, get, getFirst, getFirstIndex, getLast, getLastIndex, getMissingValue, getRange, getSize, getTimeDomain, getType, isMissing, put, put, put, put, put, remove, setRangeforEach, spliteratorpublic SparseTimeSeries(Class<T> type, TimeDomain domain, T missingValue)
type - a non-null data typedomain - a non-null time domainmissingValue - an object representing missing valuespublic SparseTimeSeries(Class<T> type, TimeDomain domain)
Double.NaN for type Double and null
for all other types.type - a non-null data typedomain - a non-null time domainpublic Iterator<Observation<T>> iterator()
TimeAddressableObservations in the time series
ordered by increasing time index. This iterator does not return any
missing value.iterator in interface TimeAddressable<T>iterator in interface Iterable<Observation<T>>public TimeAddressable<T> makeEmptyCopy()
TimeAddressablemakeEmptyCopy in interface TimeAddressable<T>public TimeIndexable<T> asIndexable() throws T2Exception
TimeAddressableasIndexable in interface TimeAddressable<T>T2Exceptionpublic TimeAddressable<T> get(long first, long last)
TimeAddressableget in interface TimeAddressable<T>get in class AbstractTimeSeries<T>first - a numerical time index giving the lower bound of the wanted rangelast - a numerical time index giving the upper bound of the wanted rangepublic TimeAddressable<T> get(Range range) throws T2Exception
TimeAddressableget in interface TimeAddressable<T>range - a non-null rangeT2Exceptionprotected Observation<T> internalGetLast(long index) throws T2Exception
AbstractTimeSeriesObservation, only a special rule for this method).internalGetLast in class AbstractTimeSeries<T>index - a numerical time indexT2Exceptionprotected Observation<T> internalGetFirst(long index) throws T2Exception
AbstractTimeSeriesObservation, only a special rule for this method).internalGetFirst in class AbstractTimeSeries<T>index - a numberT2Exceptionpublic int getValueCount()
TimeAddressablegetValueCount in interface TimeAddressable<T>public boolean isIndexable()
TimeAddressableTimeIndexable.isIndexable in interface TimeAddressable<T>protected void internalClear()
AbstractTimeSeriesinternalClear in class AbstractTimeSeries<T>protected T internalGet(long index) throws T2Exception
AbstractTimeSeriesinternalGet in class AbstractTimeSeries<T>index - a numerical time indexT2Exceptionprotected Collection<T> internalGetData()
AbstractTimeSeriesCollection.internalGetData in class AbstractTimeSeries<T>protected long internalGetFirstIndex()
AbstractTimeSeriesinternalGetFirstIndex in class AbstractTimeSeries<T>protected long internalGetLastIndex()
AbstractTimeSeriesinternalGetLastIndex in class AbstractTimeSeries<T>protected int internalGetSize()
AbstractTimeSeriesinternalGetSize in class AbstractTimeSeries<T>protected void internalPut(long index,
T value)
throws T2Exception
AbstractTimeSeriesThe method silently ignores missing values added out of range. Adding missing values at the boundary shrinks the range.
internalPut in class AbstractTimeSeries<T>index - a numerical time indexvalue - a valueT2Exceptionprotected void internalRemove(long index)
throws T2Exception
AbstractTimeSeriesinternalRemove in class AbstractTimeSeries<T>index - a numerical time indexT2Exceptionprotected void internalSetBounds(long first,
long last)
throws T2Exception
AbstractTimeSeriesinternalSetBounds in class AbstractTimeSeries<T>first - a numerical time index giving the lower bound of the new rangelast - a numerical time index giving the upper bound of the new rangeT2ExceptionCopyright © 2017. All rights reserved.