public abstract class DataItemBase extends Object implements DataItem
DataItem
interface. It also
supports
the SuspendableDataItem
interface.SuspendableDataItem
Modifier and Type | Field and Description |
---|---|
protected ItemListener |
listener |
Constructor and Description |
---|
DataItemBase(DataItemInformation information) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Variant> |
getCacheAttributes() |
protected Variant |
getCacheValue() |
DataItemInformation |
getInformation() |
protected void |
handleListenerChange(ItemListener listener) |
protected void |
notifyData(Variant value,
Map<String,Variant> attributes)
Notify a data change without checking for a real change.
|
void |
notifyData(Variant value,
Map<String,Variant> attributes,
boolean cache)
Notify a data change without checking for a real change.
|
void |
setListener(ItemListener listener)
Sets the listener for this item.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttributes, readValue, startSetAttributes, startWriteValue
protected ItemListener listener
public DataItemBase(DataItemInformation information)
public DataItemInformation getInformation()
getInformation
in interface DataItem
public void setListener(ItemListener listener)
DataItem
setListener
in interface DataItem
listener
- The listener to use or null to disable notificationprotected void handleListenerChange(ItemListener listener)
protected Variant getCacheValue()
protected void notifyData(Variant value, Map<String,Variant> attributes)
See notifyData(Variant, Map, boolean)
when and how to use the
method!
value
- the value to sendattributes
- the attributes to sendpublic void notifyData(Variant value, Map<String,Variant> attributes, boolean cache)
This method simply forwards the change notification to the currently connected listener. It does not provide any real difference check and should therefore only be called by implementations that check for difference first.
If you simple want to send data away without the need to check for
differences first see DataItemBaseChained
, DataItemInput
or one of their derivations.
value
- the value to sendattributes
- the attributes to sendcache
- cache bitCopyright © 2016 Eclipse NeoSCADA Project. All rights reserved.