|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.util.AbstractDisposable | +--gumbo.util.route.EventNode | +--gumbo.util.route.EventDataNode
An event node that sends and/or receives a single data value. A data node has a "node type" defined by its EventDataNode subclass, and a "data type" defined implicitly by its node type (such as NotifyNode and primitive data type fields, such as DoubleField) or explicitly at construction time (see ObjectField).
By default, when a data node receives an event, either as an input or with set(), it saves the value and processes the event, by calling process(). It can also relay the event to any receivers. Relay occurs after the value change, but before processing, after processing, or not at all.
Event data nodes that maintain a data value state are called "event fields". By convention, fields contain a set(), get(), implSet(), and implSend() method with a strongly typed data value (as in DoubleField). Fields also contain a no-argument constructor and a srongly typed data value constructor, for initialization. implSet() and implSend() are intended for exclusive use by event handlers.
Constructor Summary | |
EventDataNode()
|
Method Summary | |
protected boolean |
checkRouter(EventRouter router)
Called by the system to check a router before using it to connect this node to another node. |
protected abstract void |
checkSender(EventDataNode sender)
Called by the system (subclasses) to check a sender before connecting it to this node. |
void |
enableDebug(boolean enable)
Enables/disables debug event reporting. |
protected abstract java.lang.String |
getDataValue()
Get this node's data value as a string. |
java.util.List |
getReceivers()
Returns an immutable view of the event nodes (EventDataNode) connected to this node as event receivers. |
int |
getRelayType()
Gets the relay type of this event node. |
java.util.Set |
getSenders()
Returns an immutable view of the event nodes (EventDataNode) connected to this node as event senders. |
protected void |
implDispose()
Disconnects this node's senders and receivers, and then disposes its fields. |
boolean |
implSend()
Used by the system (subclasses and hosts) to send the current data value of this node to its receivers, without event processing and regardless of event relaying. |
protected void |
implSysProcess()
Used by the system (this class and subclasses) to process an input event. |
boolean |
isReceiver(EventNodeMarker receiver)
Returns true if an event node is connected to this node as an event receiver. |
boolean |
isSender(EventNodeMarker sender)
Returns true if an event node is connected to this node as an event sender. |
protected void |
process()
Called by the system (this class) when this node needs to process an event, whether the event is received through a connection or results from a set() method. |
void |
setDebug(java.lang.String tag)
Sets the configuration for debug event reporting, with the debug message being the debug tag (see setDebug(tag, msg)). |
void |
setDebug(java.lang.String tag,
java.lang.String msg)
Sets the configuration for debug event reporting. |
protected void |
setRelayType(int type)
Used by the system (subclasses and hosts) to set when and if input events (receive or set) are relayed as output events (send). |
boolean |
sync()
Synchronizes this node and its receivers to its current data value. |
Methods inherited from class gumbo.util.route.EventNode |
isLocked |
Methods inherited from class gumbo.util.AbstractDisposable |
dispose, isDisposed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventDataNode()
Method Detail |
public final boolean implSend()
public final boolean isSender(EventNodeMarker sender)
public final boolean isReceiver(EventNodeMarker receiver)
public final java.util.Set getSenders()
public final java.util.List getReceivers()
public int getRelayType()
public void setDebug(java.lang.String tag, java.lang.String msg)
-Ddebug.enabled=true -Ddebug.tags=tag
tag
- Debug tag (see Debug). Never null.msg
- Debug message. If the node has a value, "=value"
will be appended. Never null.public void setDebug(java.lang.String tag)
tag
- Debug tag (see Debug). Never null.public void enableDebug(boolean enable)
protected abstract java.lang.String getDataValue()
protected abstract void checkSender(EventDataNode sender)
protected void process()
protected final void setRelayType(int type)
type
- <1 for relay before processing. >1 for relay
after processing. 0 for no relay. The default is after processing.protected final void implSysProcess()
protected boolean checkRouter(EventRouter router)
EventNode
checkRouter
in class EventNode
public final boolean sync()
EventNode
sync
in class EventNode
protected void implDispose()
implDispose
in class AbstractDisposable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |