Class 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:
    Serialized Form
    • Constructor Detail

      • TreePath

        public TreePath​(int... path)
      • TreePath

        public TreePath​(List<Integer> pathList)
      • TreePath

        public TreePath​(TreeNode node)
    • Method Detail

      • getPath

        public int[] getPath()
      • getParent

        public TreePath getParent()
      • isRoot

        public boolean isRoot()
      • getLength

        public int getLength()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object