|
|||||||||
| 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.DynamicDataSource
simtools.data.DataSourceAnimator
public class DataSourceAnimator
This class adds dynamical features to a DataSource. This is useful to replay time series, for example. It will use the underlying source to provide the values, and has its own API to control how to advance the index : step by step, or with a timer. Note: All APIs from superclasses are redirected. So, this wrapper should really be transparent.
| Field Summary | |
|---|---|
protected boolean |
autoStop
|
protected boolean |
finished
|
static java.lang.String |
MARKER
|
protected long |
period
|
protected DataSource |
target
|
protected java.util.Timer |
timer
|
| Fields inherited from class simtools.data.DynamicDataSource |
|---|
autoRegister, cachedByte, cachedDouble, cachedFloat, cachedInteger, cachedLong, cachedObject, cachedShort, currentByte, currentDouble, currentFloat, currentInteger, currentLong, currentObject, currentShort, hasValue, info, kind, lastIndex, maxByte, maxDouble, maxFloat, maxInteger, maxLong, maxObject, maxShort, minByte, minDouble, minFloat, minInteger, minLong, minObject, minShort |
| Fields inherited from class simtools.data.DataSource |
|---|
endNotificationListeners, listeners, sortedOrder |
| Fields inherited from class simtools.data.ValueProvider |
|---|
ByteProvider, DoubleProvider, FloatProvider, IntegerProvider, LongProvider, ObjectProvider, ShortProvider |
| Constructor Summary | |
|---|---|
DataSourceAnimator(DataSource ds)
|
|
DataSourceAnimator(DataSource ds,
int delay)
|
|
DataSourceAnimator(DataSource ds,
int delay,
long period)
|
|
| Method Summary | |
|---|---|
void |
DataSourceIndexRangeChanged(DataSource ds,
long startIndex,
long lastIndex)
Called when the range of valid index changed |
void |
DataSourceInfoChanged(DataSource ds,
DataInfo newInfo)
Called when the information about the data source changed |
void |
DataSourceOrderChanged(DataSource ds,
int newOrder)
If defined, called when the order of the source changed. |
void |
DataSourceReplaced(DataSource oldData,
DataSource newData)
Called when a data source is replaced by another one |
void |
DataSourceValueChanged(DataSource ds,
long minIndex,
long maxIndex)
Called when at least a value changed in the data source. |
void |
DataSourceValueRangeChanged(DataSource ds)
Called when the range of possible values changed, if defined. |
long |
getPeriod()
|
boolean |
isAutoStop()
|
boolean |
isFinished()
|
boolean |
isRunning()
|
void |
reset()
Resets the source. |
void |
setAutoStop(boolean autoStop)
|
void |
setPeriod(long period)
Sets a period for cyclic execution |
int |
sortedOrder()
Check if the values are sorted or not. |
void |
start()
Starts to update the values with the previously set period. |
void |
start(long period)
Starts to update the values with the given period. |
void |
step()
Increase current index |
void |
stop()
Stop to update the values. |
java.lang.Class |
valueClass()
Returns the more specialized superclass of all objects returned by this provider. |
| Methods inherited from class simtools.data.DynamicDataSource |
|---|
bufferize, changeInfo, computeLastIndex, computeMinMax, computeStartIndex, getByteMax, getByteMin, getDoubleMax, getDoubleMin, getFloatMax, getFloatMin, getInformation, getIntegerMax, getIntegerMin, getKind, getLastIndex, getLongMax, getLongMin, getMax, getMin, getShortMax, getShortMin, getStartIndex, getValue, isAutoRegister, isComparable, registerNewValue, setAutoRegister, setByteValue, setDoubleValue, setFloatValue, setIntegerValue, setLongValue, setObjectValue, setShortValue |
| Methods inherited from class simtools.data.ValueProvider |
|---|
getByteValue, getDoubleValue, getFloatValue, getIntegerValue, getLongValue, getObjectValue, getShortValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MARKER
protected DataSource target
protected long period
protected java.util.Timer timer
protected boolean finished
protected boolean autoStop
| Constructor Detail |
|---|
public DataSourceAnimator(DataSource ds)
public DataSourceAnimator(DataSource ds,
int delay)
public DataSourceAnimator(DataSource ds,
int delay,
long period)
| Method Detail |
|---|
public boolean isFinished()
public void step()
throws DataException
DataExceptionpublic long getPeriod()
public void setPeriod(long period)
period, - in millisecondspublic boolean isRunning()
public void start(long period)
public void start()
public void stop()
public void reset()
public boolean isAutoStop()
public void setAutoStop(boolean autoStop)
autoStop - The autoStop to set.
public void DataSourceValueChanged(DataSource ds,
long minIndex,
long maxIndex)
DataSourceListener
DataSourceValueChanged in interface DataSourceListenerds - The data source that changedminIndex - Lower bound of the range where values changedmaxIndex - Higher bound of the range where values changed
public void DataSourceIndexRangeChanged(DataSource ds,
long startIndex,
long lastIndex)
DataSourceListener
DataSourceIndexRangeChanged in interface DataSourceListenerds - The data source that changedstartIndex - The new start IndexlastIndex - The new last index
public void DataSourceInfoChanged(DataSource ds,
DataInfo newInfo)
DataSourceListener
DataSourceInfoChanged in interface DataSourceListenerds - The data source that changedpublic void DataSourceValueRangeChanged(DataSource ds)
DataSourceListener
DataSourceValueRangeChanged in interface DataSourceListenerds - The data source that changed
public void DataSourceOrderChanged(DataSource ds,
int newOrder)
DataSourceListener
DataSourceOrderChanged in interface DataSourceListenerds - The data source that changed
public void DataSourceReplaced(DataSource oldData,
DataSource newData)
DataSourceListener
DataSourceReplaced in interface DataSourceListenerpublic int sortedOrder()
DataSource
sortedOrder in class DataSourcepublic java.lang.Class valueClass()
ValueProvider
valueClass in class DynamicDataSource
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||