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, isValid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDatabase, getId, getSurrogate, inConstruction, isValid
protected 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()
Series
getChronicle
in interface Series<T>
public SeriesDefinition getDefinition() throws T2DBException
Series
getDefinition
in interface Series<T>
T2DBException
public String getName(boolean full) throws T2DBException
Series
getName
in interface Series<T>
full
- if true return the full name else the simple nameT2DBException
public int getNumber()
Series
public List<String> getNames() throws T2DBException
Series
getNames
in interface Series<T>
T2DBException
public ValueType<T> getValueType() throws T2DBException
Series
getValueType
in interface Series<T>
T2DBException
public ch.agent.t2.time.TimeDomain getTimeDomain() throws T2DBException
Series
getTimeDomain
in interface Series<T>
T2DBException
public boolean isSparse() throws T2DBException
Series
Series.getValues(Range)
must return a sparse time series,
else it can return a sparse or a regular time series.isSparse
in interface Series<T>
T2DBException
public String getDescription(boolean full) throws T2DBException
Series
getDescription
in interface Series<T>
full
- if true return the full description, else the simple
descriptionT2DBException
public List<String> getDescriptions() throws T2DBException
Series
getDescriptions
in interface Series<T>
T2DBException
public Attribute<?> getAttribute(String name, boolean mustExist) throws T2DBException
Series
getAttribute
in interface Series<T>
name
- the name of the attributeT2DBException
public Collection<Attribute<?>> getAttributes() throws T2DBException
Series
getAttributes
in interface Series<T>
T2DBException
public 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 rangeT2DBException
ch.agent.t2.T2Exception
public ch.agent.t2.timeseries.TimeAddressable<T> getValues(ch.agent.t2.time.Range range, boolean forceSparse) throws ch.agent.t2.T2Exception, T2DBException
Series
forceSparse
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 seriesT2DBException
ch.agent.t2.T2Exception
public ch.agent.t2.timeseries.Observation<T> getLastObservation(ch.agent.t2.time.TimeIndex time) throws ch.agent.t2.T2Exception, T2DBException
Series
getLastObservation
in interface Series<T>
time
- a time index or nullT2DBException
ch.agent.t2.T2Exception
public ch.agent.t2.timeseries.Observation<T> getFirstObservation(ch.agent.t2.time.TimeIndex time) throws ch.agent.t2.T2Exception, T2DBException
Series
getFirstObservation
in interface Series<T>
time
- a time index or nullT2DBException
ch.agent.t2.T2Exception
public T getValue(ch.agent.t2.time.TimeIndex time) throws ch.agent.t2.T2Exception, T2DBException
Series
getValue
in interface Series<T>
time
- a time indexT2DBException
ch.agent.t2.T2Exception
TimeAddressable.getMissingValue()
public ch.agent.t2.time.Range getRange() throws ch.agent.t2.T2Exception, T2DBException
Series
getRange
in interface Series<T>
ch.agent.t2.T2Exception
T2DBException
public <S> Series<S> typeCheck(Class<S> type) throws T2DBException
Series
typeCheck
in interface Series<T>
type
- the underlying type requiredT2DBException
Copyright © 2017. All rights reserved.