com.h3c.util.codec

## Class CodedTree.Node

- java.lang.Object
- - com.h3c.util.codec.CodedTree.Node

- Enclosing class:
    CodedTree

      public static class CodedTree.Node
      extends Object

  This inner class represents a node in a coded tree.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CodedTree.Node(int index)` Constructs a node with the given index.
    `CodedTree.Node(int index, CodedTree.Node... children)` Constructs a node with the given index and child nodes.
    `CodedTree.Node(int index, List<CodedTree.Node> children)` Constructs a node with the given index and child nodes.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChildren(CodedTree.Node... nodes)` Adds the specified nodes as children of this node.
    `void` | `addChildren(int... indices)` Creates leaf nodes with the specified indices and attaches them as child nodes to this node.
    `boolean` | `equals(Object o)`
    `List<CodedTree.Node>` | `getChildren()` Returns the list of child nodes for this node.
    `int` | `getIndex()` Returns the "index" value for this node.
    `CodedTree.Node` | `getParent()` Returns the parent node for this node.
    `int` | `hashCode()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CodedTree.Node

          public CodedTree.Node(int index)

      Constructs a node with the given index.
      Parameters:
        `index` - the node index

    - #### CodedTree.Node

          public CodedTree.Node(int index,
                        CodedTree.Node... children)

      Constructs a node with the given index and child nodes.
      Parameters:
        `index` - the node index
        `children` - the child nodes to be attached to this node

    - #### CodedTree.Node

          public CodedTree.Node(int index,
                        List<CodedTree.Node> children)

      Constructs a node with the given index and child nodes.
      Parameters:
        `index` - the node index
        `children` - the child nodes to be attached to this node

  - ### Method Detail

    - #### getIndex

          public int getIndex()

      Returns the "index" value for this node.
      Returns:
        the index

    - #### getParent

          public CodedTree.Node getParent()

      Returns the parent node for this node. Returns null if this is a "root" node.
      Returns:
        the parent node

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### addChildren

          public void addChildren(CodedTree.Node... nodes)

      Adds the specified nodes as children of this node.
      Parameters:
        `nodes` - the child nodes

    - #### addChildren

          public void addChildren(int... indices)

      Creates leaf nodes with the specified indices and attaches them as child nodes to this node.
      Parameters:
        `indices` - the indices of the child nodes

    - #### getChildren

          public List<CodedTree.Node> getChildren()

      Returns the list of child nodes for this node. Will return null if this is a leaf node.
      Returns:
        the child nodes.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2014. All Rights Reserved.