Schnittstelle ITreeNode<T>

Typparameter:
T -
Alle bekannten Implementierungsklassen:
TreeNode

public interface ITreeNode<T>
Interface to the tree node class
  • Methodendetails

    • setParentNode

      void setParentNode(ITreeNode<T> parent)
      Sets the parent node
      Parameter:
      parent - the parent node
    • setChildNodes

      void setChildNodes(List<ITreeNode<T>> childNodes)
      Overrides the current child nodes with a list of new child nodes
      Parameter:
      childNodes - the new child nodes
    • addChild

      void addChild(ITreeNode<T> child)
      Adds a child to the list of child nodes
      Parameter:
      child - the node of the child
    • getParentNode

      ITreeNode<T> getParentNode()
      Returns the parent node
      Gibt zurück:
      the parent node
    • getChildNodes

      List<ITreeNode<T>> getChildNodes()
      Returns the child nodes
      Gibt zurück:
      the child nodes
    • getChild

      ITreeNode<T> getChild(int index)
    • setContent

      void setContent(T content)
      Sets the content of the node
      Parameter:
      content - the content
    • getContent

      T getContent()
      Returns the content of the node
      Gibt zurück:
      the content of the node
    • containsContent

      boolean containsContent(T compare, ITreeNode<T> node)
      Checks whether the node contains a given string as content "out"-Method
      Parameter:
      compare - the String that will be checked as reference
      node -
      Gibt zurück:
      true if the String equals the content, false if not
    • isSubClassOf

      boolean isSubClassOf(ITreeNode<T> parent, boolean direct)
      Checks whether the given node is sublcass of a specified node
      Parameter:
      parent - the other node the given instance might be subclass of
      direct - if true is passed, this method only returns true if the current instance is a direct sublass of the parent class
      Gibt zurück:
      true if it is a subclass of the specified parent, false if not
    • isSubClassOf

      boolean isSubClassOf(ITreeNode<T> parent)
      Checks whether the given node is sublcass of a specified node default value of direct is false
      Parameter:
      parent - the other node the given instance might be subclass of
      Gibt zurück:
      true if it is a subclass of the specified parent, false if not
    • getRoot

      ITreeNode<T> getRoot()
      Returns the root node of the current tree node
      Gibt zurück:
      the root node
    • getHeigthToLastLeaf

      int getHeigthToLastLeaf()
      Returns the height of the longest path to a leaf starting from this node. If this node is already a leaf, it returns 0
      Gibt zurück: