## com.rbnb.sapi
Class ChannelTree.Node

    java.lang.Object
      com.rbnb.sapi.ChannelTree.Node

All Implemented Interfaces:
  Serializable, Comparable

Enclosing class:
  ChannelTree

    public static final class ChannelTree.Node

extends Object
implements Serializable, Comparable

Represents a piece of a channel name. Each node has several properties which define its role in a hierarchy.

For example, the channel "/Server/Source/directory/channel" would produce the following nodes:

1. "Server", full name "/Server", type `ChannelTree.SERVER`
2. "Source", full name "/Server/Source", type `ChannelTree.SOURCE`
3. "directory", full name "/Server/Source/directory", type `ChannelTree.FOLDER`
4. "channel", full name "/Server/Source/directory/channel", type `ChannelTree.CHANNEL`

See Also:
  Serialized Form

Method Summary
`int` `compareTo(Object o)` Performs a lexicographical comparison of the full names of this and the argument, which must be of type node.
`boolean` `equals(Object o)` Compares the full names of this and the argument (of type node) for equality.
`List` `getChildren()` Returns a `List` of the children of this node.
`Map` `getChildrenMap()` Returns a `Map` of the children of this node.
`int` `getDepth()` Returns the depth of the node.
`double` `getDuration()` Returns the difference between the timestamp of the newest data and the timestamp of the oldest data in this channel.
`String` `getFullName()` Returns the fully qualified name of this node.
`String` `getMime()` Returns the MIME type of this channel node.
`String` `getName()` Returns the name of this node, which will not contain slashes.
`ChannelTree.Node` `getParent()` Returns the parent of this node, or null.
`int` `getSize()` Returns the size in bytes of a newest request on this channel.
`double` `getStart()` Returns the start time of the oldest data in this channel.
`ChannelTree.NodeTypeEnum` `getType()` Returns the type of this node.
`String` `toString()` The returned string the node's name and type.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### getParent

    public ChannelTree.Node getParent()

  Returns the parent of this node, or null.

### getChildren

    public List getChildren()

  Returns a `List` of the children of this node. If there are no children, the list will be empty.

### getChildrenMap

    public Map getChildrenMap()

  Returns a `Map` of the children of this node. If there are no children, the map will be empty.

### getType

    public ChannelTree.NodeTypeEnum getType()

  Returns the type of this node.

  See Also:
    `ChannelTree.SERVER`, `ChannelTree.SOURCE`, `ChannelTree.PLUGIN`, `ChannelTree.SINK`, `ChannelTree.FOLDER`, `ChannelTree.CHANNEL`

### getDepth

    public int getDepth()

  Returns the depth of the node. The depth is defined as the number of recursive calls to `getParent()` which may be made before returning null.

  For example, if `node.getParent().getParent()` does not return null, but `node.getParent().getParent().getParent()` does, than the depth is 2.

### getName

    public String getName()

  Returns the name of this node, which will not contain slashes.

### getFullName

    public String getFullName()

  Returns the fully qualified name of this node.

### compareTo

    public int compareTo(Object o)

  Performs a lexicographical comparison of the full names of this and the argument, which must be of type node.

  Specified by:
    `compareTo` in interface `Comparable`
  Throws:
    `ClassCastException` - If the argument is not a `ChannelTree.Node`.
    `NullPointerException` - if o is null.
  See Also:
    `String.compareTo(Object)`

### equals

    public boolean equals(Object o)

  Compares the full names of this and the argument (of type node) for equality.

  Overrides:
    `equals` in class `Object`
  Throws:
    `ClassCastException` - If the argument is not a `ChannelTree.Node`.
  Since:
    V2.5B6.
  See Also:
    `String.equals(Object)`, `compareTo(Object)`

### toString

    public String toString()

  The returned string the node's name and type.

  Overrides:
    `toString` in class `Object`

### getMime

    public String getMime()

  Returns the MIME type of this channel node. If this map was built from a registration channel map (i.e. the result of `Sink.RequestRegistration()`), it contains the MIME type of a data request made of this channel. Otherwise returns null.

  See Also:
    `Sink.RequestRegistration()`

### getSize

    public int getSize()

  Returns the size in bytes of a newest request on this channel. If this map was built from a registration channel map (i.e. the result of `Sink.RequestRegistration()`), it contains the MIME type of a data request made of this channel. Otherwise returns null.

  See Also:
    `Sink.RequestRegistration()`

### getStart

    public double getStart()

  Returns the start time of the oldest data in this channel. If this map was built from a registration channel map (i.e. the result of `Sink.RequestRegistration()`), it contains the MIME type of a data request made of this channel. Otherwise returns null.

  See Also:
    `Sink.RequestRegistration()`, `ChannelMap.GetTimeStart(int)`

### getDuration

    public double getDuration()

  Returns the difference between the timestamp of the newest data and the timestamp of the oldest data in this channel. If this map was built from a registration channel map (i.e. the result of `Sink.RequestRegistration()`), it contains the MIME type of a data request made of this channel. Otherwise returns null.

  See Also:
    `Sink.RequestRegistration()`, `ChannelMap.GetTimeDuration(int)`