Package edu.claflin.finder.algo.clustering.struct

# Class TreeNode<T extends TreeNodeInfo>

java.lang.Object
edu.claflin.finder.algo.clustering.struct.TreeNode<T>

All Implemented Interfaces:
  `Comparable<TreeNode<T>>`

public class TreeNode<T extends TreeNodeInfo> extends Object implements Comparable<TreeNode<T>>
The basic unit of the BinarySearchTree.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `private T`
  `info`
  `private TreeNode<T>`
  `left`
  `private TreeNode<T>`
  `right`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TreeNode()`
  `TreeNode(T info)`
  Create an empty TreeNode.
  `TreeNode(T info, TreeNode<T> l, TreeNode<T> r)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(TreeNode<T> that)`
  `TreeNode<T>`
  `duplicate()`
  `boolean`
  `equals(Object o)`
  `T`
  `getInfo()`
  `TreeNode<T>`
  `getLeftChild()`
  Get the left child TreeNode.
  `TreeNode<T>`
  `getRightChild()`
  Get the right child TreeNode.
  `void`
  `setInfo(T info)`
  Set the information of this TreeNode.
  `void`
  `setLeftChild(TreeNode<T> left)`
  Set the left child TreeNode.
  `void`
  `setNode(T info, TreeNode<T> l, TreeNode<T> r)`
  Set all the information of this TreeNode.
  `void`
  `setRightChild(TreeNode<T> right)`
  Set the right child TreeNode.
  `String`
  `toString()`

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

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

- ## Field Details

  - ### info

    private T extends TreeNodeInfo info

  - ### left

    private TreeNode<T extends TreeNodeInfo> left

  - ### right

    private TreeNode<T extends TreeNodeInfo> right

- ## Constructor Details

  - ### TreeNode

    public TreeNode()

  - ### TreeNode

    public TreeNode(T info)
    Create an empty TreeNode.
    Parameters:
      `info` - the information

  - ### TreeNode

    public TreeNode(T info, TreeNode<T> l, TreeNode<T> r)

- ## Method Details

  - ### getInfo

    public T getInfo()

  - ### getLeftChild

    public TreeNode<T> getLeftChild()
    Get the left child TreeNode.
    Returns:
      the left child TreeNode

  - ### getRightChild

    public TreeNode<T> getRightChild()
    Get the right child TreeNode.
    Returns:
      the right child TreeNode

  - ### setNode

    public void setNode(T info, TreeNode<T> l, TreeNode<T> r)
    Set all the information of this TreeNode.
    Parameters:
      `info` - the information
      `l` - the left child TreeNode
      `r` - the right child TreeNode

  - ### setInfo

    public void setInfo(T info)
    Set the information of this TreeNode.
    Parameters:
      `info` - the info to set

  - ### setLeftChild

    public void setLeftChild(TreeNode<T> left)
    Set the left child TreeNode.
    Parameters:
      `left` - the left child TreeNode

  - ### setRightChild

    public void setRightChild(TreeNode<T> right)
    Set the right child TreeNode.
    Parameters:
      `right` - the right child TreeNode

  - ### duplicate

    public TreeNode<T> duplicate()

  - ### compareTo

    public int compareTo(TreeNode<T> that)
    Specified by:
      `compareTo` in interface `Comparable<T extends TreeNodeInfo>`

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`