Package io.immutables.common
Class Vect<E>
java.lang.Object
io.immutables.common.Vect<E>
- Type Parameters:
E- element type
Minimalistic wrapper around immutable array. We use it over ImmutableList because
we want monomorphic call sites, no unsupported mutation methods, minimum memory
overhead, no views, have simplistic pattern matching capability and short classname.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classfinal classfinal class -
Method Summary
Modifier and TypeMethodDescriptionboolean<R> Rbipartition(Predicate<? super E> predicate, BiFunction<Vect<E>, Vect<E>, R> receiver) static <E> Vect.Builder<E>builder()static <E> Vect.Builder<E>builderWithExpectedSize(int size) booleanbooleanfirst()<R> Vect<R><A> Afold(A left, BiFunction<A, E, A> folder) <A> Afold(BiFunction<E, A, A> reducer, A right) voidstatic <E> Vect<E>Deprecated.static <E> Vect<E>get(int index) inthashCode()booleanisEmpty()iterator()last()<R> Vect<R><R> Vect<R>mapIndex(BiFunction<Integer, ? super E, ? extends R> to) static <E> Vect<E>of()static <E> Vect<E>of(E single) static <E> Vect<E>of(E... elements) static <E> Vect<E>of(E first, E second) static <E> Vect<E>of(E first, E second, E third) static <E> Vect<E>of(E first, E second, E third, E fourth) static <E> Vect<E>of(E first, E second, E third, E fourth, E fifth) <T> Vect<T>range(int from, int to) rangeFrom(int from) reduce(BiFunction<E, E, E> reducer) reverse()intsize()booleansort()sort(Comparator<? super E> comparator) stream()static <E> Collector<E,Vect.Builder<E>, Vect<E>> to()Object[]toArray()E[]E[]toArray(IntFunction<E[]> factory) toString()when()
-
Method Details
-
iterator
-
mapIndex
-
map
-
flatMap
-
findFirst
-
some
-
all
-
contains
-
forEach
-
only
-
takeWhile
-
dropWhile
-
bipartition
-
filter
-
fold
-
fold
-
prepend
-
append
-
sort
-
sort
-
reverse
-
reduce
-
range
-
rangeFrom
-
first
-
last
-
get
-
size
public int size() -
isEmpty
public boolean isEmpty() -
hashCode
public int hashCode() -
equals
-
spliterator
- Specified by:
spliteratorin interfaceIterable<E>
-
stream
-
toString
-
join
-
join
-
concat
-
toArray
-
toArray
-
toArray
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
from
Deprecated. -
from
-
builder
-
builderWithExpectedSize
-
when
-
to
-