Class TreeVisit.TreePathFragment<Node>

java.lang.Object
de.xima.fc.common.tree.TreeVisit.TreePathFragment<Node>
Type Parameters:
Node - Type of the tree nodes.
Enclosing class:
TreeVisit

public static final class TreeVisit.TreePathFragment<Node> extends Object
Represents a fragment or part of the path of a node in a tree data structure.

Assume the following tree:

  • a1
    • b
      • c1
      • c2
  • a2
Then the path of c2 consist of the following 2 fragments:
    (a1, 0), (b, 0), (c2, 1)
That is, to access c1, start at the root, access the first child (which is a1), then access the first child (which is b), then access the second child (which is c2).
Since:
8.2.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • getIndex

      public int getIndex()
      Gets the index of the node, i.e. the index of getNode() in the children list of its parent.
      Returns:
      The node's index.
    • getNode

      public Node getNode()
      Gets the node representing this path fragment.
      Returns:
      The tree node.