Class TreeNode<T>

java.lang.Object
org.europa.together.domain.TreeNode<T>
Type Parameters:
T - as generic Class

public final class TreeNode<T> extends Object
Data structure for a tree.A node is unique by is UUID, but in real environments is a more specified definition necessary. A parent node can not have two child nods with the same name. for a user is then hard to distinguish which child node is the right one. (e.g. Files and Folders)
  • Constructor Details

    • TreeNode

      public TreeNode()
      Constructor.
    • TreeNode

      public TreeNode(String name)
      Constructor.
      Parameters:
      name - as String
  • Method Details

    • getNodeName

      public String getNodeName()
      Get the name of the node.
      Returns:
      name as String
    • setNodeName

      public void setNodeName(String nodeName)
      Set the name of the node.
      Parameters:
      nodeName - as String
    • getParent

      public String getParent()
      Get the UUID of the parent node.
      Returns:
      UUID as String
    • setParent

      public void setParent(String parent)
      Set the UUID of the parent node.
      Parameters:
      parent - as String
    • getValue

      public T getValue()
      Get the value of a node.
      Returns:
      value as Object
    • setValue

      public void setValue(T value)
      Set the value of a node.
      Parameters:
      value - as Object
    • getUuid

      public String getUuid()
      Get the UUID of the node.
      Returns:
      uuid as String
    • copy

      public TreeNode<T> copy(TreeNode<T> node)
      Clone (copy) a TreeNode to a we instance.
      Parameters:
      node - as TreeNode
      Returns:
      a copy of the TreeNode
    • toString

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object