Class TreePath

java.lang.Object
org.apache.myfaces.tobago.model.TreePath
All Implemented Interfaces:
Serializable

public class TreePath extends Object implements Serializable
Handles a path in a tree from the root node to the position inside this tree. The position of the root node is dropped in the list, because it would always be zero. The path of the root node as length 0.
Example:
  + Root               Path: []
  |
  +-+ Node             Path: [0]
  | |
  | +-+ Sub-Node       Path: [0, 0]
  | |
  | +-+ Sub-Node       Path: [0, 1]
  |
  +-+ Node             Path: [1]
    |
    +-+ Sub-Node       Path: [1, 0]
    |
    +-+ Sub-Node       Path: [1, 1]
    |
    +-+ Sub-Node       Path: [1, 2]
 
Since:
1.5.0
See Also:
  • Constructor Details

    • TreePath

      public TreePath(int... path)
    • TreePath

      public TreePath(List<Integer> pathList)
    • TreePath

      public TreePath(TreeNode node)
  • Method Details

    • getPath

      public int[] getPath()
    • getParent

      public TreePath getParent()
    • isRoot

      public boolean isRoot()
    • getLength

      public int getLength()
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object