T - the class of the elements of the underlying time seriespublic class SeriesImpl<T> extends DBObjectImpl implements Series<T>
Series.| Constructor and Description |
|---|
SeriesImpl(Chronicle chronicle,
String name,
int number,
Surrogate surrogate)
Construct a
Series. |
| Modifier and Type | Method and Description |
|---|---|
UpdatableSeries<T> |
edit()
Return an
UpdatableSeries corresponding to this series. |
Attribute<?> |
getAttribute(String name,
boolean mustExist)
Return the attribute with the given name.
|
Collection<Attribute<?>> |
getAttributes()
Return all the series' attributes.
|
Chronicle |
getChronicle()
Return the chronicle to which this series belongs.
|
SeriesDefinition |
getDefinition()
Return the series' definition.
|
String |
getDescription(boolean full)
Return the description of the series.
|
List<String> |
getDescriptions()
Return the list of all descriptions along the chronicle chain and the
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.
|
String |
getName(boolean full)
Return the simple name or the full name of the series.
|
List<String> |
getNames()
Return the list of all names along the chronicle chain and the series.
|
int |
getNumber()
Return the series number within the chronicle.
|
ch.agent.t2.time.Range |
getRange()
Return the range of values.
|
ch.agent.t2.time.TimeDomain |
getTimeDomain()
Return the time domain of the series.
|
T |
getValue(ch.agent.t2.time.TimeIndex time)
Return the value of the time series at the time index specified.
|
ch.agent.t2.timeseries.TimeAddressable<T> |
getValues(ch.agent.t2.time.Range range)
Return the time series of values in the range specified.
|
ch.agent.t2.timeseries.TimeAddressable<T> |
getValues(ch.agent.t2.time.Range range,
boolean forceSparse)
Return the time series of values in the range specified.
|
ValueType<T> |
getValueType()
Return the value type of the series.
|
boolean |
isSparse()
Return true if the series is forced to use sparse time series.
|
String |
toString() |
<S> Series<S> |
typeCheck(Class<S> type)
Cast the series to the type specified.
|
protected void |
update()
Refresh state.
|
equals, getDatabase, getId, getSurrogate, hashCode, inConstruction, isValidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDatabase, getId, getSurrogate, inConstruction, isValidprotected void update()
public UpdatableSeries<T> edit()
UpdatableSeries 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 Chronicle getChronicle()
SeriesgetChronicle in interface Series<T>public SeriesDefinition getDefinition() throws T2DBException
SeriesgetDefinition in interface Series<T>T2DBExceptionpublic String getName(boolean full) throws T2DBException
SeriesgetName in interface Series<T>full - if true return the full name else the simple nameT2DBExceptionpublic int getNumber()
Seriespublic List<String> getNames() throws T2DBException
SeriesgetNames in interface Series<T>T2DBExceptionpublic ValueType<T> getValueType() throws T2DBException
SeriesgetValueType in interface Series<T>T2DBExceptionpublic ch.agent.t2.time.TimeDomain getTimeDomain()
throws T2DBException
SeriesgetTimeDomain in interface Series<T>T2DBExceptionpublic boolean isSparse()
throws T2DBException
SeriesSeries.getValues(Range) must return a sparse time series,
else it can return a sparse or a regular time series.isSparse in interface Series<T>T2DBExceptionpublic String getDescription(boolean full) throws T2DBException
SeriesgetDescription in interface Series<T>full - if true return the full description, else the simple
descriptionT2DBExceptionpublic List<String> getDescriptions() throws T2DBException
SeriesgetDescriptions in interface Series<T>T2DBExceptionpublic Attribute<?> getAttribute(String name, boolean mustExist) throws T2DBException
SeriesgetAttribute in interface Series<T>name - the name of the attributeT2DBExceptionpublic Collection<Attribute<?>> getAttributes() throws T2DBException
SeriesgetAttributes in interface Series<T>T2DBExceptionpublic ch.agent.t2.timeseries.TimeAddressable<T> getValues(ch.agent.t2.time.Range range) 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.
getValues in interface Series<T>range - the range of values wanted or null for the full rangeT2DBExceptionch.agent.t2.T2Exceptionpublic ch.agent.t2.timeseries.TimeAddressable<T> getValues(ch.agent.t2.time.Range range, boolean forceSparse) throws ch.agent.t2.T2Exception, T2DBException
SeriesforceSparse
parameter is true, a sparse time series will be used. If the code is
false but the sparsity setting of the schema for the series
requires a sparse time series, then one will be used. In all other cases
the software will decide whether to use a standard or a sparse time
series using heuristics.getValues in interface Series<T>range - the range of values wanted or null to get the full rangeforceSparse - if true use a sparse time seriesT2DBExceptionch.agent.t2.T2Exceptionpublic ch.agent.t2.timeseries.Observation<T> getLastObservation(ch.agent.t2.time.TimeIndex time) throws ch.agent.t2.T2Exception, T2DBException
SeriesgetLastObservation in interface Series<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>time - a time index or nullT2DBExceptionch.agent.t2.T2Exceptionpublic T getValue(ch.agent.t2.time.TimeIndex time) throws ch.agent.t2.T2Exception, T2DBException
SeriesgetValue in interface Series<T>time - a time indexT2DBExceptionch.agent.t2.T2ExceptionTimeAddressable.getMissingValue()public ch.agent.t2.time.Range getRange()
throws ch.agent.t2.T2Exception,
T2DBException
SeriesgetRange in interface Series<T>ch.agent.t2.T2ExceptionT2DBExceptionpublic <S> Series<S> typeCheck(Class<S> type) throws T2DBException
SeriestypeCheck in interface Series<T>type - the underlying type requiredT2DBExceptionCopyright © 2017. All rights reserved.