|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.adapters.DataInterceptor
public class DataInterceptor
DataInterceptor
filters data that belongs to DoubleConsumer.
DataInterceptor
saves a certain amount of data (defined with
timeInterval in constructor). After that time elapses average value and
standard deviation are calculated. Interceptor than updates consumer with
four values: average value at the begining and end of the interval that all
data belongs too, min and max value on this interval.
DataInterceptor
can be used with chart consumers when great
ammount of data needs to be displayed.
Constructor Summary | |
---|---|
DataInterceptor()
Default constructor. |
|
DataInterceptor(DoubleConsumer consumer,
long timeInterval)
Constructor. |
Method Summary | |
---|---|
double |
getAverage()
Returns the average value on the interval of the last dispatched data. |
DataConsumer |
getDataConsumer(java.lang.Class type)
Returns data consumer for requested data consumer type. |
DataConsumer |
getDefaultDataConsumer()
Returns the implementation of default consumer type supported by this data consumer. |
double |
getDeviation()
Returns the value of standard deviation for the last dispatched data. |
java.lang.String |
getName()
Returns name of this data consumer. |
java.lang.String[] |
getSupportedCharacteristics()
Resturns array with names of supported characteristics. |
java.lang.Class[] |
getSupportedConsumerTypes()
Returns array of supported data consumer types, which can be used as parameter and returnned with getDataCosnumer(Class)
method. |
long |
getTimeInterval()
Returns the time interval set for this interceptor. |
void |
setCharacteristics(java.util.Map characteristics)
Sets new dynamic value characteristics to this data consumer. |
void |
setConsumer(DoubleConsumer newConsumer)
Sets consumer of which this DataInterceptor intercepts
data. |
void |
setTimeInterval(long timeInterval)
Sets the time interval for calculating average and deviation. |
void |
updateDataState(DataState datastate)
Push data state (quality) update change for dynamic value. |
void |
updateValue(long timestamp,
double value)
Notifys this consumer about new dynamic value update. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataInterceptor()
public DataInterceptor(DoubleConsumer consumer, long timeInterval)
consumer
- consumers that sends data to displayertimeInterval
- time interval in millisMethod Detail |
---|
public void setTimeInterval(long timeInterval)
timeInterval
- public long getTimeInterval()
public double getDeviation()
public double getAverage()
public void updateValue(long timestamp, double value) throws CommonException
DoubleConsumer
updateValue
in interface DoubleConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
public void setConsumer(DoubleConsumer newConsumer)
DataInterceptor
intercepts
data.
newConsumer
- public DataConsumer getDataConsumer(java.lang.Class type)
DataConsumer
Returns data consumer for requested data consumer type. If this data
consumer does not support required data consumer, null
is
returned.
If this data cosnumer does not support specific data consumer type, then it means, that it is not desirable to cast data of that type to any by this consumer supported data consumer types.
getDataConsumer
in interface DataConsumer
type
- Class of specific data consumer (e.g. DoubleConsumer)
null
if
not supportedpublic DataConsumer getDefaultDataConsumer()
DataConsumer
getDefaultDataConsumer
in interface DataConsumer
public void updateDataState(DataState datastate)
DataConsumer
updateDataState
in interface DataConsumer
datastate
- new data state(quality) descriptorpublic void setCharacteristics(java.util.Map characteristics)
DataConsumer
setCharacteristics
in interface DataConsumer
characteristics
- the Map
with attripublic java.lang.String getName()
DataConsumer
getName
in interface DataConsumer
public java.lang.String[] getSupportedCharacteristics()
DataConsumer
null
is returned, than
consumer expect all existing characteristics from data source.
getSupportedCharacteristics
in interface DataConsumer
public java.lang.Class[] getSupportedConsumerTypes()
DataConsumer
getDataCosnumer(Class)
method.
getSupportedConsumerTypes
in interface DataConsumer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |