Class MockTreeNode

java.lang.Object
com.jalios.util.MockTreeNode
All Implemented Interfaces:
TreeNode, Comparable

public class MockTreeNode extends Object implements TreeNode, Comparable
  • Field Details

  • Constructor Details

    • MockTreeNode

      public MockTreeNode(String str)
    • MockTreeNode

      public MockTreeNode(String str, TreeNode... child)
  • Method Details

    • addChild

      public void addChild(MockTreeNode node)
    • getName

      public String getName()
    • getId

      public String getId()
      Description copied from interface: TreeNode
      Returns id of the current node
      Specified by:
      getId in interface TreeNode
      Returns:
      String Node id
    • getTreeChildren

      public Collection<TreeNode> getTreeChildren()
      Description copied from interface: TreeNode
      Returns a Collection of TreeNode children of the current node
      Specified by:
      getTreeChildren in interface TreeNode
      Returns:
      Collection of TreeNode
    • getTreeParent

      public TreeNode getTreeParent()
      Description copied from interface: TreeNode
      Returns parent of the current node
      Specified by:
      getTreeParent in interface TreeNode
      Returns:
      TreeNode parent Node
    • isTreeLeaf

      public boolean isTreeLeaf()
      Description copied from interface: TreeNode
      Returns boolean true if the TreeNode is a leaf
      Specified by:
      isTreeLeaf in interface TreeNode
      Returns:
      boolean indicating if node is leaf or node
    • isTreeNode

      public boolean isTreeNode()
      Description copied from interface: TreeNode
      Returns boolean true if the TreeNode is a node
      Specified by:
      isTreeNode in interface TreeNode
      Returns:
      boolean indicating if node is leaf or node
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getTreeRoot

      public TreeNode getTreeRoot()
      Description copied from interface: TreeNode
      Returns the root of the current node
      Specified by:
      getTreeRoot in interface TreeNode
      Returns:
      TreeNode root Node