|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rbnb.sapi.ChannelTree
public final class ChannelTree
A ChannelMap accessory which provides a read-only hierarchical
view of channels. This is useful mainly for clients who wish to present
such a view to end users, such as RBNB Admin.
The ChannelTree is created from a ChannelMap
via a factory method,
createFromChannelMap(ChannelMap). The tree consists of objects
of type ChannelTree.Node. Each node represents a name
between slashes.
For example, a ChannelMap consisting of the channel: '/Server/source/c0' would yield a root node 'Server', with a child 'source', who has a child 'c0'. Note that for user constructed ChannelMaps, it is possible to have multiple roots. So a map with the channels 'foo' and 'bar' would yield a "tree" with two roots, 'foo' and 'bar'.
For an explanation of how name matching works, see
Sink.Request.
Requires Java 1.2 or later.
Sink.Request(com.rbnb.sapi.ChannelMap cm,
double start,
double duration,
String reference),
Serialized Form| Nested Class Summary | |
|---|---|
static class |
ChannelTree.Node
Represents a piece of a channel name. |
static class |
ChannelTree.NodeTypeEnum
Enumerated type for various channel node types. |
| Field Summary | |
|---|---|
static ChannelTree.NodeTypeEnum |
CHANNEL
The node type which represents a data bearing channel node. |
static ChannelTree.NodeTypeEnum |
CONTROLLER
The node type which represents an RBNB control client. |
static ChannelTree |
EMPTY_TREE
|
static ChannelTree.NodeTypeEnum |
FOLDER
The node type which represents a organizational node without data. |
static ChannelTree.NodeTypeEnum |
PLUGIN
The node type which represents a PlugIn (a dynamic data source). |
static ChannelTree.NodeTypeEnum |
SERVER
The node type which represents an RBNB server. |
static ChannelTree.NodeTypeEnum |
SINK
The node type which represents a data sink. |
static ChannelTree.NodeTypeEnum |
SOURCE
The node type which represents a data source. |
| Method Summary | |
|---|---|
static ChannelTree |
createFromChannelMap(ChannelMap cmap)
Creates a new read only view of the provided channel map. |
static ChannelTree |
createFromChannelMap(ChannelMap cmap,
String rootName)
Creates a new read only view of the provided channel map with a single named root node. |
ChannelTree.Node |
findNode(String fullname)
Returns the node which exactly matches the given full name, or null. |
Iterator |
iterator()
Allows iteration over the entire tree. |
ChannelTree |
merge(ChannelTree toMerge)
Produces a new tree, which is the result of merging this with the map toMerge. |
Iterator |
rootIterator()
Allows iteration over the root nodes only. |
String |
toString()
Uses iterator() to traverse this Tree and provide a
hierarchical debug output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ChannelTree.NodeTypeEnum CONTROLLER
public static final ChannelTree.NodeTypeEnum SERVER
public static final ChannelTree.NodeTypeEnum SOURCE
public static final ChannelTree.NodeTypeEnum PLUGIN
public static final ChannelTree.NodeTypeEnum SINK
public static final ChannelTree.NodeTypeEnum FOLDER
public static final ChannelTree.NodeTypeEnum CHANNEL
public static final ChannelTree EMPTY_TREE
| Method Detail |
|---|
public static ChannelTree createFromChannelMap(ChannelMap cmap)
NullPointerException - if map is null.
public static ChannelTree createFromChannelMap(ChannelMap cmap,
String rootName)
FOLDER.
It forms the base of the hierarchy, such that all roots in the
ChannelMap are children of this root, and it is the only root.
NullPointerException - if the map of root name is null.
IllegalArgumentException - if the root name is empty.public ChannelTree merge(ChannelTree toMerge)
In general, bigTree.merge(smallTree) is faster than
smallTree.merge(bigTree).
public ChannelTree.Node findNode(String fullname)
public Iterator rootIterator()
public Iterator iterator()
public String toString()
iterator() to traverse this Tree and provide a
hierarchical debug output.
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||