|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.displayers.DoubleConsumerMulticaster
public class DoubleConsumerMulticaster
DoubleConsumerMulticaster
casts different data consumers to
DoubleConsumer. ObjectConsumer cast must receive Number
instances. Delegate must be set, before any other method can be used.
Field Summary | |
---|---|
static java.lang.Class[] |
PREFERED_CONSUMER_TYPES
Types of data consumers, that should be prefered by DoubleConsumer parent. |
static java.lang.Class[] |
SUPPORTED_CONSUMER_TYPES
Types of data consumers, that are supported by this multicaster. |
Constructor Summary | |
---|---|
DoubleConsumerMulticaster()
Creates a new DoubleConsumerMulticaster object. |
|
DoubleConsumerMulticaster(DoubleConsumer delegate)
Creates a new DoubleConsumerMulticaster object. |
Method Summary | ||
---|---|---|
static DoubleConsumer |
createDataConsumer(java.lang.Class type,
DoubleConsumer delegate)
If multicaster supports type, new multicaster is created, otherwise null is returned. |
|
|
getDataConsumer(java.lang.Class<D> type)
Returns data consumer for requested data consumer type. |
|
DataConsumer |
getDefaultDataConsumer()
Returns the implementation of default consumer type supported by this data consumer. |
|
DoubleConsumer |
getDelegate()
Returns the consumer to which all call sare delegated. |
|
java.lang.String |
getName()
Returns name of this data consumer. |
|
java.lang.String[] |
getSupportedCharacteristics()
Resturns array with names of supported characteristics. |
|
java.lang.Class<DataConsumer>[] |
getSupportedConsumerTypes()
Returns array of supported data consumer types, which can be used as parameter and returnned with getDataCosnumer(Class)
method. |
|
void |
setCharacteristics(java.util.Map characteristics)
Sets new dynamic value characteristics to this data consumer. |
|
void |
setDelegate(DoubleConsumer delegate)
Sets the consumer to which all call sare delegated. |
|
void |
updateDataState(DataState state)
Push data state (quality) update change for dynamic value. |
|
void |
updateValue(long timestamp,
double value)
Notifys this consumer about new dynamic value update. |
|
void |
updateValue(long timestamp,
long value)
Notifys this consumer about new dynamic value update. |
|
void |
updateValue(long timestamp,
java.lang.Number value)
Notifys this consumer about new dynamic value update. |
|
void |
updateValue(long timestamp,
java.lang.Object value)
Notifys this consumer about new dynamic value update. |
|
void |
updateValue(long timestamp,
java.lang.String 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 |
Field Detail |
---|
public static final java.lang.Class[] SUPPORTED_CONSUMER_TYPES
public static final java.lang.Class[] PREFERED_CONSUMER_TYPES
Constructor Detail |
---|
public DoubleConsumerMulticaster(DoubleConsumer delegate)
delegate
- the consumer to which all call sare delegatedpublic DoubleConsumerMulticaster()
Method Detail |
---|
public static final DoubleConsumer createDataConsumer(java.lang.Class type, DoubleConsumer delegate)
null
is returned.
type
- the requested consumer typedelegate
- the consumer to which all call sare delegated
null
public DoubleConsumer getDelegate()
public void setDelegate(DoubleConsumer delegate)
delegate
- the consumer to which all calls are delegatedpublic 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 updateValue(long timestamp, java.lang.Number value) throws CommonException
NumberConsumer
updateValue
in interface NumberConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
public void updateValue(long timestamp, long value) throws CommonException
LongConsumer
updateValue
in interface LongConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
public DataConsumer getDefaultDataConsumer()
DataConsumer
getDefaultDataConsumer
in interface DataConsumer
public java.lang.String getName()
DataConsumer
getName
in interface DataConsumer
public void setCharacteristics(java.util.Map characteristics)
DataConsumer
setCharacteristics
in interface DataConsumer
characteristics
- the Map
with attripublic void updateDataState(DataState state)
DataConsumer
updateDataState
in interface DataConsumer
state
- new data state(quality) descriptorpublic void updateValue(long timestamp, java.lang.String value) throws CommonException
StringConsumer
updateValue
in interface StringConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
public void updateValue(long timestamp, java.lang.Object value) throws CommonException
ObjectConsumer
updateValue
in interface ObjectConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
public java.lang.String[] getSupportedCharacteristics()
DataConsumer
null
is returned, than
consumer expect all existing characteristics from data source.
getSupportedCharacteristics
in interface DataConsumer
public <D extends DataConsumer> D getDataConsumer(java.lang.Class<D> 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 java.lang.Class<DataConsumer>[] 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 |