Class Path<T>

  • Type Parameters:
    T - The type of the path elements

    @ParametersAreNonnullByDefault
    public class Path<T>
    extends Object
    This data structure can represent a sequence o elements, such as: - File paths: "/usr/local/bin" - Domain names: "org.atlanmod.commons" - Namespaces: "java.util.function.BiFunction"
    • Method Detail

      • size

        public int size()
        Returns the number of elements composing this Path
        Returns:
        the size of this path
      • hashCode

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

        public T last()
        Returns the last element (length -1) of the path
        Returns:
        the last element
      • head

        public T head()
        Returns the head, i.e., the first element (0) of the path
        Returns:
        the first element
      • tail

        public Path<T> tail()
      • of

        @SafeVarargs
        public static <E> Path<E> of​(E... values)
        Creates a new Path from a sequence of values
        Type Parameters:
        E - The type of the path elements
        Parameters:
        values - The elements of the path
        Returns:
        the type of the path elements