|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.adapters.FeedbackConsumerSupport
public class FeedbackConsumerSupport
FeedbackConsumerSupport
is support class fo all implementators
who want to implement consumer, which receives requests for data change
from data consumers and displayers.
CommonDisplayer
Field Summary | |
---|---|
protected java.lang.String |
name
|
Constructor Summary | |
---|---|
FeedbackConsumerSupport()
Creates new instance. |
Method Summary | |
---|---|
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. |
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. |
void |
setCharacteristics(java.util.Map characteristics)
Sets new dynamic value characteristics to this data consumer. |
void |
updateAcynchronously(UpdateRequest request)
Forwards call to updateRequest() and replays to request
when update finishes. |
void |
updateDataState(DataState state)
Push data state (quality) update change for dynamic value. |
void |
updateNonblocking(java.lang.Number value)
Forwards call to updateRequest() . |
void |
updateNonblocking(java.lang.Object value)
Forwards call to updateRequest() . |
void |
updateNonblocking(java.lang.String value)
Forwards call to updateRequest() . |
protected void |
updateRequest(long timestamp,
java.lang.Number value)
This method is called whenever any of number updates is called. |
protected void |
updateRequest(long timestamp,
java.lang.Object value)
This method is called whenever any of Object updates is called. |
protected void |
updateRequest(long timestamp,
java.lang.String value)
This method is called whenever any of String updates is called. |
void |
updateSynchronously(long timestamp,
java.lang.Number value)
Forwards call to updateRequest() . |
void |
updateSynchronously(long timestamp,
java.lang.Object value)
Forwards call to updateRequest() . |
void |
updateSynchronously(long timestamp,
java.lang.String value)
Forwards call to updateRequest() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
Constructor Detail |
---|
public FeedbackConsumerSupport()
Method Detail |
---|
public void updateAcynchronously(UpdateRequest request) throws CommonException
updateRequest()
and replays to request
when update finishes.
updateAcynchronously
in interface AsynchronousNumberConsumer
updateAcynchronously
in interface AsynchronousObjectConsumer
updateAcynchronously
in interface AsynchronousStringConsumer
request
- the update request, holds
UpdateRequestlistener
which asynchronously receives
reponse
CommonException
AsynchronousStringConsumer.updateAcynchronously(com.cosylab.gui.displayers.UpdateRequest)
public void updateSynchronously(long timestamp, java.lang.Number value) throws CommonException
updateRequest()
.
updateSynchronously
in interface SynchronousNumberConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
SynchronousNumberConsumer.updateSynchronously(long,
java.lang.Number)
public void updateSynchronously(long timestamp, java.lang.Object value) throws CommonException
updateRequest()
.
updateSynchronously
in interface SynchronousObjectConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
SynchronousObjectConsumer.updateSynchronously(long,
java.lang.Object)
public void updateSynchronously(long timestamp, java.lang.String value) throws CommonException
updateRequest()
.
updateSynchronously
in interface SynchronousStringConsumer
timestamp
- the time of dynamic value eventvalue
- new value
CommonException
SynchronousStringConsumer.updateSynchronously(long,
java.lang.String)
public void updateNonblocking(java.lang.Number value)
updateRequest()
.
updateNonblocking
in interface NonblockingNumberConsumer
value
- new valueNonblockingNumberConsumer.updateNonblocking(java.lang.Number)
public void updateNonblocking(java.lang.Object value)
updateRequest()
.
updateNonblocking
in interface NonblockingObjectConsumer
value
- new valueNonblockingObjectConsumer.updateNonblocking(java.lang.Object)
public void updateNonblocking(java.lang.String value)
updateRequest()
.
updateNonblocking
in interface NonblockingStringConsumer
value
- new valueNonblockingStringConsumer.updateNonblocking(java.lang.String)
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 state)
DataConsumer
updateDataState
in interface DataConsumer
state
- 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
protected void updateRequest(long timestamp, java.lang.Number value)
timestamp
- value
- protected void updateRequest(long timestamp, java.lang.Object value)
timestamp
- value
- protected void updateRequest(long timestamp, java.lang.String value)
timestamp
- value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |