Class NTuple

    • Constructor Detail

      • NTuple

        public NTuple​(@NonNull
                      @NonNull Object[] other)
        Instantiates a new N tuple.
        Parameters:
        other - the other
    • Method Detail

      • of

        public static NTuple of​(@NonNull
                                @NonNull Object... items)
        Creates an NTuple of the given items
        Parameters:
        items - the items
        Returns:
        the NTuple
      • of

        public static NTuple of​(@NonNull
                                @NonNull List<?> items)
        Creates an NTuple of the given items
        Parameters:
        items - the items
        Returns:
        the NTuple
      • array

        public Object[] array()
        Description copied from class: Tuple
        The tuple as an array of objects
        Specified by:
        array in class Tuple
        Returns:
        an array representing the items in the tuple
      • copy

        public NTuple copy()
        Description copied from interface: Copyable

        Makes a copy of this object.

        Returns:
        A copy of this object.
      • degree

        public int degree()
        Description copied from class: Tuple
        The number of items in the tuple
        Specified by:
        degree in class Tuple
        Returns:
        the number of items in the tuple
      • get

        public <T> T get​(int i)
        Description copied from class: Tuple
        Gets the ith item of the tuple.
        Overrides:
        get in class Tuple
        Type Parameters:
        T - the type parameter
        Parameters:
        i - the index of the item
        Returns:
        the item at the ith index