Class Tree.Path

    • Method Detail

      • length

        public int length()
        Return the path length, which is the level of the child this path points to.
        Returns:
        the path length
      • get

        public int get​(int index)
        Return the child index at the given index (child level).
        Parameters:
        index - the path index
        Returns:
        the child index at the given child level
        Throws:
        IndexOutOfBoundsException - if the index is not with the range [0, length())
      • toArray

        public int[] toArray()
        Return the path as int[] array.
        Returns:
        the path as int[] array
      • append

        public Tree.Path append​(Tree.Path path)
        Appends the given path to this one.
        Parameters:
        path - the path to append
        Returns:
        a new Path with the given path appended
        Throws:
        NullPointerException - if the given path is null
      • of

        public static Tree.Path of​(int... path)
        Create a new path object from the given child indexes.
        Parameters:
        path - the child indexes
        Returns:
        a new tree path
        Throws:
        IllegalArgumentException - if one of the path elements is smaller than zero