Package org.midheaven.collections
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>
An
EditableSequence that behaves like an array.-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <X> Array<X> empty()Returns an empty instance.static <X> Array<X> Creates a newArrayof the given type and size.static <X> Array<X> of(X... values) Creates a newArraywith the given valuesstatic <X> Array<X> repeat(X value, int size) Creates a newArrayof the given size where all values are the same as the given non-null valueMethods inherited from interface org.midheaven.collections.Assortment
containsAll, count, isEmptyMethods inherited from interface org.midheaven.collections.EditableSequence
reversed, setAt, setAt, setFirst, setLast, subSequence, toSequence, toUnmodifiableMethods inherited from interface org.midheaven.collections.Enumerable
allMatch, any, anyMatch, as, associate, associate, collect, concat, distinct, enumerator, flatMap, groupBy, limit, maximum, minimum, peek, reduce, reduce, skip, toArray, toArray, toArray, toDistinctAssortment, toSequence, with, zipMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.midheaven.collections.Sequence
cast, contains, filter, first, getAt, getAt, indexOf, iterator, last, lastIndexOf, map, ofType, reverseIterator, sorted, subSequence, toCollection
-
Method Details
-
empty
Returns an empty instance.- Returns:
- an empty instance.
-
newArray
Creates a newArrayof the given type and size. All positions are set tonull. Primitive types are not allowed. -
of
Creates a newArraywith the given values- Parameters:
values- the values of the array- Returns:
- the created array
-
repeat
Creates a newArrayof the given size where all values are the same as the given non-null value- Parameters:
value- the given valuesize- the size of the array- Returns:
- the created array
-