|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.displayers.DataSourceSupport com.cosylab.gui.adapters.DataConsumerDispatcher com.cosylab.gui.adapters.AbstractConverter com.cosylab.gui.adapters.SimpleConverterSupport
public abstract class SimpleConverterSupport
SimpleConverterSupport
is implementation of
Converter
interface intended for simple implementation, which
use transfromation function on double data flow.
Note! This implementation works only with data sources and consumers,
whcih support double
as value type.
Converter
,
Serialized FormField Summary | |
---|---|
protected int |
arrayIndex
|
static java.lang.String |
SHORT_NAME
|
Fields inherited from class com.cosylab.gui.adapters.AbstractConverter |
---|
nonblDispatcher |
Fields inherited from class com.cosylab.gui.adapters.DataConsumerDispatcher |
---|
name |
Fields inherited from class com.cosylab.gui.displayers.DataSourceSupport |
---|
types |
Constructor Summary | |
---|---|
SimpleConverterSupport()
Creates new converter. |
Method Summary | |
---|---|
int |
getArrayIndex()
Returns the arrayIndex. |
protected NonblockingNumberDispatcher |
getNonblDisplatecher()
Override this method to provide own dispatcher, which forwards revers data flow (from consumer to source). |
protected abstract double |
inverseTransform(double value)
User must implement this method to make inverse transformation as in transfirm(double) function. |
void |
setArrayIndex(int arrayIndex)
Sets new arrayIndex. |
protected abstract double |
transform(double value)
User must implement this method and from prvided parameter calculate with own transfromatin function new value and return it. |
void |
updateValue(long timestamp,
double value)
This is called by peer data source. |
void |
updateValue(long timestamp,
double[] value)
Notifys this consumer about new dynamic value update. |
Methods inherited from class com.cosylab.gui.adapters.AbstractConverter |
---|
addConsumer, cacheLastCharacteristics, clear, clone, consumerAdded, getLastCharacteristics, setCharacteristics, updateDataState |
Methods inherited from class com.cosylab.gui.adapters.DataConsumerDispatcher |
---|
getDataConsumer, getDefaultDataConsumer, getName, getSupportedCharacteristics, getSupportedConsumerTypes |
Methods inherited from class com.cosylab.gui.displayers.DataSourceSupport |
---|
extractSupportedCharacteristics, getAcceptableConsumerTypes, getConsumers, removeAllConsumers, removeConsumer |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.cosylab.gui.adapters.Converter |
---|
clone |
Methods inherited from interface com.cosylab.gui.displayers.DataSource |
---|
addConsumer, getAcceptableConsumerTypes, getConsumers, removeAllConsumers, removeConsumer |
Methods inherited from interface com.cosylab.gui.displayers.DataConsumer |
---|
getDataConsumer, getDefaultDataConsumer, getName, getSupportedCharacteristics, getSupportedConsumerTypes, setCharacteristics, updateDataState |
Field Detail |
---|
public static final java.lang.String SHORT_NAME
protected int arrayIndex
Constructor Detail |
---|
public SimpleConverterSupport()
Method Detail |
---|
public int getArrayIndex()
public void setArrayIndex(int arrayIndex)
arrayIndex
- The arrayIndex to set.public void updateValue(long timestamp, double value) throws CommonException
updateValue
in interface DoubleConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
DoubleConsumer.updateValue(long, double)
protected NonblockingNumberDispatcher getNonblDisplatecher()
AbstractConverter
getNonblDisplatecher
in class AbstractConverter
protected abstract double transform(double value)
value
- the value to be transfirmed
protected abstract double inverseTransform(double value)
transfirm(double)
function. Following must be true
some_value == inverseTransform(transfirm(some_value))
.
value
- the value to be transfirmed with inverse function
transform(double)
public void updateValue(long timestamp, double[] value) throws CommonException
DoubleSeqConsumer
updateValue
in interface DoubleSeqConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |