|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.data.ValueProvider
simtools.data.DataSource
simtools.data.async.TimeStampedDataSource
simtools.data.async.StreamingTSDataSource
public class StreamingTSDataSource
A streaming time stamped data source is a time stamped data source where the values are collected dynamically The source is updated using add(time, value). It keeps in memory in minimum number of time/values pairs according to constructor parameters
Nested Class Summary | |
---|---|
protected class |
StreamingTSDataSource.AuxiliaryCollection
|
class |
StreamingTSDataSource.StreamingTimeSource
|
Nested classes/interfaces inherited from class simtools.data.async.TimeStampedDataSource |
---|
TimeStampedDataSource.TimeSource |
Field Summary | |
---|---|
protected double |
_dmax
|
protected double |
_dmin
|
protected int |
_lastIndex
|
protected int |
_maxSize
A maximal size for buffer buffer size |
protected double |
_minDuration
The minimum duration is used to check when the buffer is filled if we have enough samples according to the time elpased between the first and the last sample. |
protected int |
_size
The buffer size |
protected int |
_startIndex
|
protected double[] |
_t
|
protected double[] |
_t2
|
protected TimeStampedDataSource.TimeSource |
_time2
Auxiliary dataSource time2 |
protected double[] |
_v
|
Fields inherited from class simtools.data.async.TimeStampedDataSource |
---|
_auxiliaries |
Fields inherited from class simtools.data.DataSource |
---|
endNotificationListeners, listeners, sortedOrder |
Fields inherited from class simtools.data.ValueProvider |
---|
ByteProvider, DoubleProvider, FloatProvider, IntegerProvider, kind, LongProvider, ObjectProvider, ShortProvider |
Constructor Summary | |
---|---|
StreamingTSDataSource(java.lang.String label,
java.lang.String id,
StreamingTSDataSourceCollection c,
int minSize,
int maxSize,
double minDuration)
Create a new data source with the following parameters |
|
StreamingTSDataSource(java.lang.String label,
java.lang.String id,
StreamingTSDataSourceCollection c,
int minSize,
int maxSize,
double minDuration,
boolean withTime2)
Create a new data source with the following parameters |
Method Summary | |
---|---|
void |
add(double t,
double v)
Add a new pair of time,value and notify listeners |
void |
add(double t,
double v,
double t2)
Add a new time,value,time2 and notify listeners |
void |
addValues(double t,
double v,
double t2)
Add a new time,value,time2 |
protected void |
computeMinMax()
|
double |
getDoubleMax()
|
double |
getDoubleMin()
|
double |
getDoubleValue(long index)
Optimized accessor for double values. |
double |
getEnd()
|
long |
getLastIndex()
|
java.lang.Object |
getMax()
|
java.lang.Object |
getMin()
Return values if possibly only, without expensive computations. |
double |
getStart()
|
long |
getStartIndex()
|
TimeStampedDataSource.TimeSource |
getTime2()
|
java.lang.Object |
getValue(long index)
|
protected void |
initialiseIndex(int minSize)
Method initialiseIndex Summary: This method initialise the DataSource index. |
boolean |
isValid()
|
void |
notifyAllEndNotificationListeners()
|
void |
setTime2(TimeStampedDataSource.TimeSource time2)
|
Methods inherited from class simtools.data.async.TimeStampedDataSource |
---|
createEmptyDataSource, getAuxiliarySources, getCollection, getDataSourceInformationClass, getInfo, getInformation, getName, getTime, isCompound, setInfo, setMax, setMin, setMinmax, setTime, toString |
Methods inherited from class simtools.data.ValueProvider |
---|
getByteValue, getFloatValue, getIntegerValue, getKind, getLongValue, getObjectValue, getShortValue, valueClass |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int _startIndex
protected int _lastIndex
protected double[] _t
protected double[] _t2
protected double[] _v
protected double _dmin
protected double _dmax
protected int _size
protected TimeStampedDataSource.TimeSource _time2
protected final double _minDuration
protected int _maxSize
Constructor Detail |
---|
public StreamingTSDataSource(java.lang.String label, java.lang.String id, StreamingTSDataSourceCollection c, int minSize, int maxSize, double minDuration, boolean withTime2) throws java.io.IOException, TimeStampedDataSourceCollection.InvalidFormatException
label
- The data source nameid
- The data source idc
- Its collection parentminSize
- The minimum number of values to keepmaxSize
- The maximum number of values to keepminDuration
- The minimun duration of value to keepwithTime2
- If true time2 values are also stored
java.io.IOException
TimeStampedDataSourceCollection.InvalidFormatException
public StreamingTSDataSource(java.lang.String label, java.lang.String id, StreamingTSDataSourceCollection c, int minSize, int maxSize, double minDuration) throws java.io.IOException, TimeStampedDataSourceCollection.InvalidFormatException
label
- The data source nameid
- The data source idc
- Its collection parentminSize
- The minimum number of values to keepmaxSize
- The maximum number of values to keepminDuration
- The minimun duration of value to keep
java.io.IOException
TimeStampedDataSourceCollection.InvalidFormatException
Method Detail |
---|
protected void initialiseIndex(int minSize)
minSize
- The minSize to use at initialisation.public double getStart() throws DataException
getStart
in class TimeStampedDataSource
DataException
public double getEnd() throws DataException
getEnd
in class TimeStampedDataSource
DataException
protected void computeMinMax() throws UnsupportedOperation
computeMinMax
in class TimeStampedDataSource
UnsupportedOperation
public double getDoubleMin() throws DataException
getDoubleMin
in class TimeStampedDataSource
DataException
public java.lang.Object getMin()
DataSource
getMin
in class TimeStampedDataSource
public double getDoubleMax() throws DataException
getDoubleMax
in class TimeStampedDataSource
DataException
public java.lang.Object getMax()
getMax
in class TimeStampedDataSource
public java.lang.Object getValue(long index) throws DataException
getValue
in class TimeStampedDataSource
DataException
public double getDoubleValue(long index) throws DataException
ValueProvider
getDoubleValue
in class TimeStampedDataSource
DataException
public long getStartIndex() throws UnsupportedOperation
getStartIndex
in class TimeStampedDataSource
UnsupportedOperation
public long getLastIndex() throws UnsupportedOperation
getLastIndex
in class TimeStampedDataSource
UnsupportedOperation
public boolean isValid()
isValid
in class TimeStampedDataSource
public void add(double t, double v)
t
- v
- public void add(double t, double v, double t2)
t
- v
- t2
- t2Enabled
- public void addValues(double t, double v, double t2)
t
- v
- t2
- t2Enabled
- public void notifyAllEndNotificationListeners()
public void setTime2(TimeStampedDataSource.TimeSource time2)
time
- The time to set.public TimeStampedDataSource.TimeSource getTime2()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |