Top Description Inners Constructors Methods
org.eclipse.collections.impl.list.immutable

pack-priv abstract Class AbstractImmutableList<T>

extends AbstractImmutableCollection<T>
implements ImmutableList<T>, List<T>
Class Inheritance
All Implemented Interfaces
java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable, org.eclipse.collections.api.list.ImmutableList, org.eclipse.collections.api.list.ListIterable, org.eclipse.collections.api.ordered.ReversibleIterable, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, org.eclipse.collections.api.collection.ImmutableCollection
Known Direct Subclasses
org.eclipse.collections.impl.list.immutable.AbstractImmutableList.ImmutableSubList, org.eclipse.collections.impl.list.immutable.ImmutableArrayList, org.eclipse.collections.impl.list.immutable.ImmutableDecapletonList, org.eclipse.collections.impl.list.immutable.ImmutableDoubletonList, org.eclipse.collections.impl.list.immutable.ImmutableEmptyList, org.eclipse.collections.impl.list.immutable.ImmutableNonupletonList, org.eclipse.collections.impl.list.immutable.ImmutableOctupletonList, org.eclipse.collections.impl.list.immutable.ImmutableQuadrupletonList, org.eclipse.collections.impl.list.immutable.ImmutableQuintupletonList, org.eclipse.collections.impl.list.immutable.ImmutableSeptupletonList, org.eclipse.collections.impl.list.immutable.ImmutableSextupletonList, org.eclipse.collections.impl.list.immutable.ImmutableSingletonList, org.eclipse.collections.impl.list.immutable.ImmutableTripletonList
Imports
java.io.Serializable, java.util.Collection, .Comparator, .Iterator, .List, .ListIterator, .Objects, .RandomAccess, java.util.concurrent.ExecutorService, java.util.function.UnaryOperator, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.block.HashingStrategy, org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .DoubleObjectToDoubleFunction, .FloatFunction, .FloatObjectToFloatFunction, .IntFunction, .IntObjectToIntFunction, .LongFunction, .LongObjectToLongFunction, .ShortFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.collection.MutableCollection, org.eclipse.collections.api.factory.Lists, org.eclipse.collections.api.factory.primitive.BooleanLists, .ByteLists, .CharLists, .DoubleLists, .FloatLists, .IntLists, .LongLists, .ShortLists, org.eclipse.collections.api.list.ImmutableList, .MutableList, .ParallelListIterable, org.eclipse.collections.api.list.primitive.ImmutableBooleanList, .ImmutableByteList, .ImmutableCharList, .ImmutableDoubleList, .ImmutableFloatList, .ImmutableIntList, .ImmutableLongList, .ImmutableShortList, .MutableBooleanList, .MutableByteList, .MutableCharList, .MutableDoubleList, .MutableFloatList, .MutableIntList, .MutableLongList, .MutableShortList, org.eclipse.collections.api.multimap.MutableMultimap, org.eclipse.collections.api.multimap.list.ImmutableListMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.list.PartitionImmutableList, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.block.factory.Functions, .HashingStrategies, org.eclipse.collections.impl.block.procedure.CollectIfProcedure, .CollectProcedure, .FlatCollectProcedure, .RejectProcedure, .SelectInstancesOfProcedure, .SelectProcedure, org.eclipse.collections.impl.collection.immutable.AbstractImmutableCollection, org.eclipse.collections.impl.lazy.ReverseIterable, org.eclipse.collections.impl.lazy.parallel.list.ListIterableParallelIterable, org.eclipse.collections.impl.list.mutable.FastList, org.eclipse.collections.impl.multimap.list.FastListMultimap, org.eclipse.collections.impl.stack.mutable.ArrayStack, org.eclipse.collections.impl.utility.Iterate, .ListIterate, .OrderedIterate

This class is the parent class for all ImmutableLists. All implementations of ImmutableList must implement the List interface so anArrayList.equals(anImmutableList) can return true when the contents and order are the same.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
add(int index, T element)

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).

public boolean
addAll(int index, Collection<? extends T> collection)

Implements java.util.List.addAll.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

public void
appendString(Appendable appendable, String start, String separator, String end)

Overrides org.eclipse.collections.impl.AbstractRichIterable.appendString.

Implements org.eclipse.collections.api.RichIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public ParallelListIterable<T>
asParallel(ExecutorService executorService, int batchSize)

Implements org.eclipse.collections.api.list.ListIterable.asParallel.

Returns a parallel iterable of this ListIterable.

public ReverseIterable<T>
asReversed()

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.asReversed.

Returns a reversed view of this ReversibleIterable.

public List<T>
public RichIterable<RichIterable<T>>
public <V> ImmutableList<V>
collect(Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.list.ImmutableList.collect, org.eclipse.collections.api.collection.ImmutableCollection.collect, org.eclipse.collections.api.RichIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public ImmutableBooleanList
collectBoolean(BooleanFunction<? super T> booleanFunction)

Implements org.eclipse.collections.api.list.ImmutableList.collectBoolean, org.eclipse.collections.api.collection.ImmutableCollection.collectBoolean, org.eclipse.collections.api.RichIterable.collectBoolean.

Returns a new primitive boolean iterable with the results of applying the specified function on each element of the source collection.

public ImmutableByteList
collectByte(ByteFunction<? super T> byteFunction)

Implements org.eclipse.collections.api.list.ImmutableList.collectByte, org.eclipse.collections.api.collection.ImmutableCollection.collectByte, org.eclipse.collections.api.RichIterable.collectByte.

Returns a new primitive byte iterable with the results of applying the specified function on each element of the source collection.

public ImmutableCharList
collectChar(CharFunction<? super T> charFunction)

Implements org.eclipse.collections.api.list.ImmutableList.collectChar, org.eclipse.collections.api.collection.ImmutableCollection.collectChar, org.eclipse.collections.api.RichIterable.collectChar.

Returns a new primitive char iterable with the results of applying the specified function on each element of the source collection.

public ImmutableDoubleList
collectDouble(DoubleFunction<? super T> doubleFunction)

Implements org.eclipse.collections.api.list.ImmutableList.collectDouble, org.eclipse.collections.api.collection.ImmutableCollection.collectDouble, org.eclipse.collections.api.RichIterable.collectDouble.

Returns a new primitive double iterable with the results of applying the specified function on each element of the source collection.

public ImmutableFloatList
collectFloat(FloatFunction<? super T> floatFunction)

Implements org.eclipse.collections.api.list.ImmutableList.collectFloat, org.eclipse.collections.api.collection.ImmutableCollection.collectFloat, org.eclipse.collections.api.RichIterable.collectFloat.

Returns a new primitive float iterable with the results of applying the specified function on each element of the source collection.

public <V> ImmutableList<V>
collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.list.ImmutableList.collectIf, org.eclipse.collections.api.collection.ImmutableCollection.collectIf, org.eclipse.collections.api.RichIterable.collectIf.

Returns a new collection with the results of applying the specified function on each element of the source collection, but only for those elements which return true upon evaluation of the predicate.

public ImmutableIntList
collectInt(IntFunction<? super T> intFunction)

Implements org.eclipse.collections.api.list.ImmutableList.collectInt, org.eclipse.collections.api.collection.ImmutableCollection.collectInt, org.eclipse.collections.api.RichIterable.collectInt.

Returns a new primitive int iterable with the results of applying the specified function on each element of the source collection.

public ImmutableLongList
collectLong(LongFunction<? super T> longFunction)

Implements org.eclipse.collections.api.list.ImmutableList.collectLong, org.eclipse.collections.api.collection.ImmutableCollection.collectLong, org.eclipse.collections.api.RichIterable.collectLong.

Returns a new primitive long iterable with the results of applying the specified function on each element of the source collection.

public ImmutableShortList
collectShort(ShortFunction<? super T> shortFunction)

Implements org.eclipse.collections.api.list.ImmutableList.collectShort, org.eclipse.collections.api.collection.ImmutableCollection.collectShort, org.eclipse.collections.api.RichIterable.collectShort.

Returns a new primitive short iterable with the results of applying the specified function on each element of the source collection.

public <P, V> ImmutableList<V>
collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

Implements org.eclipse.collections.api.list.ImmutableList.collectWith, org.eclipse.collections.api.collection.ImmutableCollection.collectWith, org.eclipse.collections.api.RichIterable.collectWith.

Same as collect(Function) with a Function2 and specified parameter which is passed to the block.

public <P, V, R extends Collection<V>> R
collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.collectWith.

Implements org.eclipse.collections.api.RichIterable.collectWith.

Same as collectWith but with a targetCollection parameter to gather the results.

public <S> boolean
corresponds(OrderedIterable<S> other, Predicate2<? super T, ? super S> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.corresponds.

Returns true if both OrderedIterables have the same length and predicate returns true for all corresponding elements e1 of this OrderedIterable and e2 of other.

public int
count(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.count.

Implements org.eclipse.collections.api.RichIterable.count.

Return the total number of elements that answer true to the specified predicate.

public int
detectIndex(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.detectIndex.

Returns the index of the first element of the OrderedIterable for which the predicate evaluates to true.

public int
detectLastIndex(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.ordered.ReversibleIterable.detectLastIndex.

Returns the index of the last element of the ReversibleIterable for which the predicate evaluates to true.

public ImmutableList<T>
distinct()

Implements org.eclipse.collections.api.list.ImmutableList.distinct.

Returns a new ListIterable containing the distinct elements in this list.

public ImmutableList<T>
distinct(HashingStrategy<? super T> hashingStrategy)

Implements org.eclipse.collections.api.list.ImmutableList.distinct.

Returns a new ListIterable containing the distinct elements in this list.

public <V> ImmutableList<T>
distinctBy(Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.list.ImmutableList.distinctBy.

Returns a new ListIterable containing the distinct elements in this list.

public ImmutableList<T>
drop(int count)

Implements org.eclipse.collections.api.list.ImmutableList.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

public ImmutableList<T>
dropWhile(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.list.ImmutableList.dropWhile.

Returns the final elements that do not satisfy the Predicate.

public boolean
equals(Object that)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.list.ListIterable.equals, java.util.List.equals, java.util.Collection.equals.

Compares the specified object with this list for equality.

public <V> ImmutableList<V>
public <V, R extends Collection<V>> R
flatCollect(Function<? super T, ? extends Iterable<V>> function, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.flatCollect.

Implements org.eclipse.collections.api.RichIterable.flatCollect.

Same as flatCollect, only the results are collected into the target collection.

public void
forEach(int from, int to, Procedure<? super T> procedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEach.

Iterates over the section of the iterable covered by the specified inclusive indexes.

public <P> void
forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

public void
forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWithIndex.

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex, org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

public void
forEachWithIndex(int from, int to, ObjectIntProcedure<? super T> objectIntProcedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

Iterates over the section of the iterable covered by the specified inclusive indexes.

public T
public T
public <V> ImmutableListMultimap<V, T>
groupBy(Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.list.ImmutableList.groupBy, org.eclipse.collections.api.collection.ImmutableCollection.groupBy, org.eclipse.collections.api.RichIterable.groupBy.

For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable.

public <V, R extends MutableMultimap<V, T>> R
groupBy(Function<? super T, ? extends V> function, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.groupBy.

Implements org.eclipse.collections.api.RichIterable.groupBy.

Same as groupBy(Function), except that the results are gathered into the specified target multimap.

public <V> ImmutableListMultimap<V, T>
groupByEach(Function<? super T, ? extends Iterable<V>> function)

Implements org.eclipse.collections.api.list.ImmutableList.groupByEach, org.eclipse.collections.api.collection.ImmutableCollection.groupByEach, org.eclipse.collections.api.RichIterable.groupByEach.

Similar to groupBy(Function), except the result of evaluating function will return a collection of keys for each value.

public <V, R extends MutableMultimap<V, T>> R
groupByEach(Function<? super T, ? extends Iterable<V>> function, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.groupByEach.

Implements org.eclipse.collections.api.RichIterable.groupByEach.

Same as groupByEach(Function), except that the results are gathered into the specified target multimap.

public int
public int
indexOf(Object object)

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.indexOf.

Implements java.util.List.indexOf.

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

public <IV> IV
injectInto(IV injectedValue, Function2<? super IV, ? super T, ? extends IV> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public int
injectInto(int injectedValue, IntObjectToIntFunction<? super T> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final int result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public long
injectInto(long injectedValue, LongObjectToLongFunction<? super T> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final long result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public double
injectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final double result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public float
injectInto(float injectedValue, FloatObjectToFloatFunction<? super T> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final float result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public Iterator<T>
iterator()

Implements java.lang.Iterable.iterator, java.util.List.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this list in proper sequence.

public int
lastIndexOf(Object object)

Implements org.eclipse.collections.api.list.ListIterable.lastIndexOf, java.util.List.lastIndexOf.

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

public ListIterator<T>
listIterator()

Implements org.eclipse.collections.api.list.ListIterable.listIterator, java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).

public ListIterator<T>
listIterator(int index)

Implements org.eclipse.collections.api.list.ListIterable.listIterator, java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.

public T
max(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.max.

Implements org.eclipse.collections.api.RichIterable.max.

Returns the maximum element out of this container based on the comparator.

public T
max()

Overrides org.eclipse.collections.impl.AbstractRichIterable.max.

Implements org.eclipse.collections.api.RichIterable.max, org.eclipse.collections.api.ordered.OrderedIterable.max.

Returns the maximum element out of this container based on the natural order.

public <V extends Comparable<? super V>> T
maxBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.maxBy.

Implements org.eclipse.collections.api.RichIterable.maxBy.

Returns the maximum elements out of this container based on the natural order of the attribute returned by Function.

public T
min(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.min.

Implements org.eclipse.collections.api.RichIterable.min.

Returns the minimum element out of this container based on the comparator.

public T
min()

Overrides org.eclipse.collections.impl.AbstractRichIterable.min.

Implements org.eclipse.collections.api.RichIterable.min, org.eclipse.collections.api.ordered.OrderedIterable.min.

Returns the minimum element out of this container based on the natural order.

public <V extends Comparable<? super V>> T
minBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.minBy.

Implements org.eclipse.collections.api.RichIterable.minBy.

Returns the minimum elements out of this container based on the natural order of the attribute returned by Function.

protected MutableCollection<T>
public ImmutableList<T>
newWithAll(Iterable<? extends T> elements)

Implements org.eclipse.collections.api.list.ImmutableList.newWithAll, org.eclipse.collections.api.collection.ImmutableCollection.newWithAll.

This method is similar to the withAll method in MutableCollection with the difference that a new copy of this collection with the elements appended will be returned.

public ImmutableList<T>
newWithout(T element)

Implements org.eclipse.collections.api.list.ImmutableList.newWithout, org.eclipse.collections.api.collection.ImmutableCollection.newWithout.

This method is similar to the without method in MutableCollection with the difference that a new copy of this collection with the element removed will be returned.

public ImmutableList<T>
newWithoutAll(Iterable<? extends T> elements)

Implements org.eclipse.collections.api.list.ImmutableList.newWithoutAll, org.eclipse.collections.api.collection.ImmutableCollection.newWithoutAll.

This method is similar to the withoutAll method in MutableCollection with the difference that a new copy of this collection with the elements removed will be returned.

public PartitionImmutableList<T>
partition(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.list.ImmutableList.partition, org.eclipse.collections.api.collection.ImmutableCollection.partition, org.eclipse.collections.api.RichIterable.partition.

Filters a collection into a PartitionedIterable based on the evaluation of the predicate.

public PartitionImmutableList<T>
partitionWhile(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.list.ImmutableList.partitionWhile.

Returns a Partition of the initial elements that satisfy the Predicate and the remaining elements.

public <P> PartitionImmutableList<T>
partitionWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.list.ImmutableList.partitionWith, org.eclipse.collections.api.collection.ImmutableCollection.partitionWith, org.eclipse.collections.api.RichIterable.partitionWith.

Filters a collection into a PartitionIterable based on the evaluation of the predicate.

private boolean
protected boolean
public ImmutableList<T>
reject(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.list.ImmutableList.reject, org.eclipse.collections.api.collection.ImmutableCollection.reject, org.eclipse.collections.api.RichIterable.reject.

Returns all elements of the source collection that return false when evaluating of the predicate.

public <P> ImmutableList<T>
rejectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.list.ImmutableList.rejectWith, org.eclipse.collections.api.collection.ImmutableCollection.rejectWith, org.eclipse.collections.api.RichIterable.rejectWith.

Similar to reject(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

public <P, R extends Collection<T>> R
rejectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.rejectWith.

Implements org.eclipse.collections.api.RichIterable.rejectWith.

Similar to reject(Predicate, Collection), except with an evaluation parameter for the second generic argument in Predicate2.

public T
remove(int index)

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).

public void
replaceAll(UnaryOperator<T> operator)

Overrides default java.util.List.replaceAll.

Replaces each element of this list with the result of applying the operator to that element (optional operation).

public ImmutableList<T>
select(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.list.ImmutableList.select, org.eclipse.collections.api.collection.ImmutableCollection.select, org.eclipse.collections.api.RichIterable.select.

Returns all elements of the source collection that return true when evaluating the predicate.

public <S> ImmutableList<S>
public <P> ImmutableList<T>
selectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.list.ImmutableList.selectWith, org.eclipse.collections.api.collection.ImmutableCollection.selectWith, org.eclipse.collections.api.RichIterable.selectWith.

Similar to select(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

public <P, R extends Collection<T>> R
selectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.selectWith.

Implements org.eclipse.collections.api.RichIterable.selectWith.

Similar to select(Predicate, Collection), except with an evaluation parameter for the second generic argument in Predicate2.

public T
set(int index, T element)

Implements java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

public void
sort(Comparator<? super T> c)

Overrides default java.util.List.sort.

Sorts this list according to the order induced by the specified Comparator (optional operation).

public AbstractImmutableList.ImmutableSubList<T>
subList(int fromIndex, int toIndex)

Implements org.eclipse.collections.api.list.ImmutableList.subList, java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

public double
sumOfDouble(DoubleFunction<? super T> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.sumOfDouble.

Implements org.eclipse.collections.api.RichIterable.sumOfDouble.

Returns the final double result of evaluating function for each element of the iterable and adding the results together.

public double
sumOfFloat(FloatFunction<? super T> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.sumOfFloat.

Implements org.eclipse.collections.api.RichIterable.sumOfFloat.

Returns the final double result of evaluating function for each element of the iterable and adding the results together.

public long
sumOfInt(IntFunction<? super T> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.sumOfInt.

Implements org.eclipse.collections.api.RichIterable.sumOfInt.

Returns the final long result of evaluating function for each element of the iterable and adding the results together.

public long
sumOfLong(LongFunction<? super T> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.sumOfLong.

Implements org.eclipse.collections.api.RichIterable.sumOfLong.

Returns the final long result of evaluating function for each element of the iterable and adding the results together.

public ImmutableList<T>
take(int count)

Implements org.eclipse.collections.api.list.ImmutableList.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

public ImmutableList<T>
takeWhile(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.list.ImmutableList.takeWhile.

Returns the initial elements that satisfy the Predicate.

public ImmutableList<T>
tap(Procedure<? super T> procedure)

Implements org.eclipse.collections.api.list.ImmutableList.tap, org.eclipse.collections.api.collection.ImmutableCollection.tap, org.eclipse.collections.api.RichIterable.tap.

Executes the Procedure for each element in the iterable and returns this.

public ImmutableList<T>
toImmutable()

Implements org.eclipse.collections.api.list.ListIterable.toImmutable.

Converts the ListIterable to an immutable implementation.

public ImmutableList<T>
toReversed()

Implements org.eclipse.collections.api.list.ImmutableList.toReversed.

Returns a new ReversibleIterable in reverse order.

public <S> ImmutableList<Pair<T, S>>
zip(Iterable<S> that)

Implements org.eclipse.collections.api.list.ImmutableList.zip, org.eclipse.collections.api.collection.ImmutableCollection.zip, org.eclipse.collections.api.RichIterable.zip.

Returns a RichIterable formed from this RichIterable and another RichIterable by combining corresponding elements in pairs.

public ImmutableList<Pair<T, Integer>>
Inherited from org.eclipse.collections.impl.collection.immutable.AbstractImmutableCollection:
addaddAllcastToCollectionclearcountBycountByEachcountByWithgroupByUniqueKeyparallelStreamreduceremoveremoveAllremoveAllFromretainAllspliteratorstreamsumByDoublesumByFloatsumByIntsumByLongtoArraytoArray