Interface Array<T>

Type Parameters:
T - type of element in the Array
All Superinterfaces:
Assortment<T>, Countable, EditableSequence<T>, Enumerable<T>, Iterable<T>, RandomAccess, Sequence<T>

public interface Array<T> extends EditableSequence<T>, RandomAccess
An EditableSequence that behaves like an array.
  • Method Details

    • empty

      static <X> Array<X> empty()
      Returns an empty instance.
      Returns:
      an empty instance.
    • newArray

      static <X> Array<X> newArray(Class<X> type, int size)
      Creates a new Array of the given type and size. All positions are set to null. Primitive types are not allowed.
      Parameters:
      type - the type of the Array
      size - the size of the Array
      Returns:
      the created array
    • of

      static <X> Array<X> of(X... values)
      Creates a new Array with the given values
      Parameters:
      values - the values of the array
      Returns:
      the created array
    • repeat

      static <X> Array<X> repeat(X value, int size)
      Creates a new Array of the given size where all values are the same as the given non-null value
      Parameters:
      value - the given value
      size - the size of the array
      Returns:
      the created array