| java.lang.Object ti.chimera.registry.Node
All known Subclasses: ti.chimera.registry.PersistentNode,
Node | public class Node (Code) | | Base class for a node in the tree. A node can have an optional contract,
which constraints what values can be assigned to this node. If no
contract is specified, the null-contract (ie. accept any value) will be
used.
Clients can subscribe to the value of the node, in which case every time
the node's value is changed, the new value will be published to them.
(Also, the current value is immediately published, upon subscription.)
All changes to a node are published in the order they occur.
NOTE: currently it is possible that a value be published to a subscriber
after the subscriber has been unsubscribed, but only if the change
that is being published occurred before the subscriber unsubscribed.
author: ;Rob Clark;a0873619;San Diego;; version: 0.1 |
Inner Class :public static class SwingWorker implements Worker | |
Inner Class :public static class NonSwingWorker extends WorkerThread implements Worker | |
Constructor Summary | |
public | Node(Object value, NodeContract contract, String comment) Class Constructor.
Parameters: value - the node's initial value Parameters: contract - the node's contract, or null Parameters: comment - a string containing a description of the purposeof this node, the node's usage, etc. |
Node | public Node(Object value, NodeContract contract, String comment)(Code) | | Class Constructor.
Parameters: value - the node's initial value Parameters: contract - the node's contract, or null Parameters: comment - a string containing a description of the purposeof this node, the node's usage, etc. Can contain HTML markup. |
getComment | public String getComment()(Code) | | Get the node's comment.
a string |
getNodeContract | public NodeContract getNodeContract()(Code) | | Get the node's contract.
the NodeContract |
getPathCount | int getPathCount()(Code) | | Get the number of paths this node is linked in to. This is used
by the registry-core because it is an error to remove the last
link to a node if it still has children.
|
getPrimaryPath | public String getPrimaryPath()(Code) | | Get the primary path of this node. If the node is not linked into
the registry tree, then this will be null . Otherwise
this will be the first path this node is linked in to but has not
yet been unlinked from.
a path or null . |
getValue | public Object getValue()(Code) | | Get the current value of the node.
the node's current value |
link | void link(String path)(Code) | | Called by the registry before this node is linked in to the tree. This
should not be called anywhere else, otherwise undefined behaviour may
ensue. (Translation: Nothing to see here, move along.).
|
setValue | public void setValue(Object value)(Code) | | Set the value of this node, and publish the new value to all the
subscribers.
Parameters: value - the node's new value |
subscribe | public void subscribe(NodeSubscriber s)(Code) | | Add the subscriber to the list of registered subscribers, and
immediately publish the current value.
Parameters: s - the subscriber |
unlink | void unlink(String path)(Code) | | Called by the registry before this node is unlinked in from the tree.
This should not be called anywhere else, otherwise undefined behaviour
may ensue. (Translation: Nothing to see here, move along.).
|
unsubscribe | public void unsubscribe(NodeSubscriber s)(Code) | | Remove the subscriber from the list of registered subscribers.
Parameters: s - the subscriber |
|
|