T - the class of the elements of the underlying time seriespublic class UpdatableSeriesImpl<T> extends SeriesImpl<T> implements UpdatableSeries<T>
UpdatableSeries.| Constructor and Description |
|---|
UpdatableSeriesImpl(Chronicle chronicle,
String name,
int number,
Surrogate surrogate)
Construct an
UpdatableSeries. |
| Modifier and Type | Method and Description |
|---|---|
void |
applyUpdates()
Apply pending updates.
|
void |
destroy()
Destroy the series.
|
UpdatableSeries<T> |
edit()
Return an
UpdatableSeries corresponding to this series. |
ch.agent.t2.timeseries.Observation<T> |
getFirstObservation(ch.agent.t2.time.TimeIndex time)
Return the observation at the given time index or the first following
observation.
|
ch.agent.t2.timeseries.Observation<T> |
getLastObservation(ch.agent.t2.time.TimeIndex time)
Return the observation at the give time index or the last preceding
observation.
|
ch.agent.t2.time.Range |
getRange()
Return the range of values.
|
ch.agent.t2.timeseries.TimeAddressable<T> |
getValues(ch.agent.t2.time.Range reqRange)
Return the time series of values in the range specified.
|
void |
scanValue(ch.agent.t2.time.TimeIndex t,
Object value)
Add a value to the list of pending updates.
|
boolean |
setRange(ch.agent.t2.time.Range range)
Set the range of the series.
|
void |
setValue(ch.agent.t2.time.TimeIndex t,
T value)
Add a value to the list of pending updates.
|
void |
setValues(ch.agent.t2.timeseries.TimeAddressable<T> values)
Set the time series to the list of pending updates.
|
<S> UpdatableSeries<S> |
typeCheck(Class<S> type)
Cast the series to the type specified.
|
protected void |
update()
Refresh state.
|
getAttribute, getAttributes, getChronicle, getDefinition, getDescription, getDescriptions, getName, getNames, getNumber, getTimeDomain, getValue, getValues, getValueType, isSparse, toStringequals, getDatabase, getId, getSurrogate, hashCode, inConstruction, isValidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAttribute, getAttributes, getChronicle, getDefinition, getDescription, getDescriptions, getName, getNames, getNumber, getTimeDomain, getValue, getValues, getValueType, isSparsegetDatabase, getId, getSurrogate, inConstruction, isValidpublic UpdatableSeriesImpl(Chronicle chronicle, String name, int number, Surrogate surrogate)
UpdatableSeries.chronicle - a chroniclename - a stringnumber - a positive numbersurrogate - a surrogatepublic UpdatableSeries<T> edit()
SeriesImplUpdatableSeries corresponding to this series.
Successfully getting an Updatable object does not imply
that updates can be successfully applied.
The new and old objects share internal data.
public <S> UpdatableSeries<S> typeCheck(Class<S> type) throws T2DBException
SeriestypeCheck in interface Series<T>typeCheck in interface UpdatableSeries<T>typeCheck in class SeriesImpl<T>type - the underlying type requiredT2DBExceptionpublic ch.agent.t2.timeseries.TimeAddressable<T> getValues(ch.agent.t2.time.Range reqRange) throws ch.agent.t2.T2Exception, T2DBException
The usage of a sparse time series for the result depends on the series
schema (SeriesDefinition.isSparse() or on heuristics.
An updatable series always uses a sparse time series to ensure that arbitrary large gaps can be accommodated.
getValues in interface Series<T>getValues in class SeriesImpl<T>reqRange - the range of values wanted or null for the full rangeT2DBExceptionch.agent.t2.T2Exceptionpublic ch.agent.t2.time.Range getRange()
throws ch.agent.t2.T2Exception,
T2DBException
SeriesgetRange in interface Series<T>getRange in class SeriesImpl<T>ch.agent.t2.T2ExceptionT2DBExceptionpublic ch.agent.t2.timeseries.Observation<T> getLastObservation(ch.agent.t2.time.TimeIndex time) throws ch.agent.t2.T2Exception, T2DBException
SeriesgetLastObservation in interface Series<T>getLastObservation in class SeriesImpl<T>time - a time index or nullT2DBExceptionch.agent.t2.T2Exceptionpublic ch.agent.t2.timeseries.Observation<T> getFirstObservation(ch.agent.t2.time.TimeIndex time) throws ch.agent.t2.T2Exception, T2DBException
SeriesgetFirstObservation in interface Series<T>getFirstObservation in class SeriesImpl<T>time - a time index or nullT2DBExceptionch.agent.t2.T2Exceptionpublic void scanValue(ch.agent.t2.time.TimeIndex t,
Object value)
throws ch.agent.t2.T2Exception,
T2DBException
UpdatableSeriesscanValue in interface UpdatableSeries<T>t - a time indexvalue - a valueT2DBExceptionch.agent.t2.T2Exceptionpublic void setValue(ch.agent.t2.time.TimeIndex t,
T value)
throws ch.agent.t2.T2Exception,
T2DBException
UpdatableSeriessetValue in interface UpdatableSeries<T>t - a time indexvalue - a valueT2DBExceptionch.agent.t2.T2Exceptionpublic void setValues(ch.agent.t2.timeseries.TimeAddressable<T> values) throws ch.agent.t2.T2Exception, T2DBException
UpdatableSeriessetValues in interface UpdatableSeries<T>values - a time series of valuesT2DBExceptionch.agent.t2.T2Exceptionpublic boolean setRange(ch.agent.t2.time.Range range)
throws ch.agent.t2.T2Exception,
T2DBException
UpdatableSeriessetRange in interface UpdatableSeries<T>range - a range or null to clear the rangech.agent.t2.T2ExceptionT2DBExceptionpublic void destroy()
throws T2DBException
UpdatableSeriesdestroy in interface UpdatableSeries<T>T2DBExceptionpublic void applyUpdates()
throws T2DBException
UpdatableDatabase.commit() and
Database.rollback() is the client's responsibility.applyUpdates in interface UpdatableT2DBExceptionprotected void update()
SeriesImplupdate in class SeriesImpl<T>Copyright © 2017. All rights reserved.