Class GenericTreeNode<T>

java.lang.Object
org.tasktide.parser.generic_tree.GenericTreeNode<T>
Type Parameters:
T - - Data Type of Tree

public class GenericTreeNode<T> extends Object
Datapoint of GenericTree
  • Constructor Details

    • GenericTreeNode

      public GenericTreeNode(T data, String address)
      Construct tree node
      Parameters:
      data -
      address -
  • Method Details

    • getAddress

      public String getAddress()
      Get address of node
      Returns:
      String
    • getData

      public T getData()
      Get value of node
      Returns:
      T
    • setData

      public void setData(T data)
      Set value of node
      Parameters:
      data -
    • getChildren

      public Map<String, GenericTreeNode<T>> getChildren()
      Get the children of current node
      Returns:
      Map-String, GenericTreeNode
    • getParent

      public GenericTreeNode<T> getParent()
      Get parent of current node
      Returns:
    • setParent

      public void setParent(GenericTreeNode<T> parent)
      Set the parent of current node
      Parameters:
      parent -
    • isLeaf

      public boolean isLeaf()
      Check whether current node has children/is leaf node
      Returns:
      boolean
    • hasChild

      public boolean hasChild(String query)
      Check whether current node has queried child
      Parameters:
      query -
      Returns:
      boolean
    • listChildren

      public Set<String> listChildren()
      Fetch names of current nodes children
      Returns:
      Set-String
    • removeChild

      public boolean removeChild(String key)
      Remove provided key from children
      Parameters:
      key -
      Returns:
      boolean
    • clearChildren

      public void clearChildren()
      Clear all child nodes