Top Description Inners Fields Constructors Methods
org.eclipse.collections.impl.list.mutable

public final Class CompositeFastList<E>

extends AbstractMutableList<E>
implements BatchIterable<E>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.eclipse.collections.impl.parallel.BatchIterable
Imports
java.io.Serializable, java.lang.reflect.Array, java.util.Collection, .Collections, .Comparator, .Iterator, .List, .ListIterator, .NoSuchElementException, java.util.concurrent.ExecutorService, java.util.function.UnaryOperator, org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.function.primitive.DoubleObjectToDoubleFunction, .FloatObjectToFloatFunction, .IntObjectToIntFunction, .LongObjectToLongFunction, 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.list.MutableList, .ParallelListIterable, org.eclipse.collections.impl.AbstractRichIterable, org.eclipse.collections.impl.block.factory.Predicates, org.eclipse.collections.impl.lazy.parallel.list.NonParallelListIterable, org.eclipse.collections.impl.parallel.BatchIterable, .ParallelIterate, org.eclipse.collections.impl.utility.Iterate

CompositeFastList behaves like a list, but is composed of at least one list. It is useful where you don't want the additional expense of appending several lists or allocating memory for a super list to add multiple sublists to.

Note

mutation operations (e.g. add and remove, sorting) will change the underlying lists - so be sure to only use a composite list where it will be the only reference to the sublists (for example, a composite list which contains multiple query results is OK as long as it is the only thing that references the lists)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final FastList<FastList<E>>
private static final Predicate2<FastList<?>, Object>
private static final Procedure<FastList<?>>
private static final long
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
add(E object)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.add.

Implements java.util.Collection.add, java.util.List.add.

Appends the specified element to the end of this list (optional operation).

public void
add(int index, E element)

Implements java.util.List.add.

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

public boolean
addAll(Collection<? extends E> collection)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.addAll.

Implements java.util.Collection.addAll, java.util.List.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).

public boolean
addAll(int index, Collection<? extends E> 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
addComposited(Collection<? extends E> collection)

public boolean
allSatisfy(Predicate<? super E> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.allSatisfy.

Implements org.eclipse.collections.api.RichIterable.allSatisfy.

Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty.

public <P> boolean
allSatisfyWith(Predicate2<? super E, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.allSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.allSatisfyWith.

Returns true if the predicate evaluates to true for every element of the collection, or returns false.

public boolean
anySatisfy(Predicate<? super E> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.anySatisfy.

Implements org.eclipse.collections.api.RichIterable.anySatisfy.

Returns true if the predicate evaluates to true for any element of the iterable.

public <P> boolean
anySatisfyWith(Predicate2<? super E, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.anySatisfyWith.

Implements org.eclipse.collections.api.RichIterable.anySatisfyWith.

Returns true if the predicate evaluates to true for any element of the collection, or return false.

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

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.asParallel.

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

Returns a parallel iterable of this ListIterable.

public void
batchForEach(Procedure<? super E> procedure, int sectionIndex, int sectionCount)

Implements org.eclipse.collections.impl.parallel.BatchIterable.batchForEach.

public void
clear()

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.clear.

Implements java.util.Collection.clear, java.util.List.clear.

Removes all of the elements from this list (optional operation).

public MutableList<E>
public <V, R extends Collection<V>> R
collect(Function<? super E, ? extends V> function, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.collect.

Implements org.eclipse.collections.api.RichIterable.collect.

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

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

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.collectWith.

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

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

public boolean
public boolean
public int
count(Predicate<? super E> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.count.

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

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

public <P> int
countWith(Predicate2<? super E, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.countWith.

Implements org.eclipse.collections.api.RichIterable.countWith.

Returns the total number of elements that evaluate to true for the specified predicate.

public void
each(Procedure<? super E> procedure)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.each.

Implements org.eclipse.collections.api.RichIterable.each.

The procedure is executed for each element in the iterable.

private void
flattenLists()

convert multiple contained lists into one list and replace the contained lists with that list.

public <P> void
forEachWith(Procedure2<? super E, ? super P> procedure2, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.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 E> objectIntProcedure)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.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 E
get(int index)

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

Returns the element at the specified position in this list.

public int
public int
indexOf(Object o)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.indexOf.

Overrides default org.eclipse.collections.api.list.MutableList.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 E, ? extends IV> function)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.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 E> function)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.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 float
injectInto(float injectedValue, FloatObjectToFloatFunction<? super E> function)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.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 long
injectInto(long injectedValue, LongObjectToLongFunction<? super E> function)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.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 E> 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 boolean
public Iterator<E>
public int
lastIndexOf(Object o)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.lastIndexOf.

Implements java.util.List.lastIndexOf, org.eclipse.collections.api.list.ListIterable.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<E>

Returns:

a ListIterator for this, with internal state converted to one list if needed.
listIterator
()

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.listIterator.

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

a list iterator is a problem for a composite list as going back in the order of the list is an issue, as are the other methods like set() and add() (and especially, remove).

public ListIterator<E>

Returns:

a ListIterator for this, with internal state converted to one list if needed.
listIterator
(int index)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.listIterator.

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

a list iterator is a problem for a composite list as going back in the order of the list is an issue, as are the other methods like set() and add() (and especially, remove).

public boolean
noneSatisfy(Predicate<? super E> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.noneSatisfy.

Implements org.eclipse.collections.api.RichIterable.noneSatisfy.

Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty.

public <P> boolean
noneSatisfyWith(Predicate2<? super E, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.noneSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.noneSatisfyWith.

Returns true if the predicate evaluates to false for every element of the collection, or return false.

private void
rangeCheck(int index)

public <R extends Collection<E>> R
reject(Predicate<? super E> predicate, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.reject.

Implements org.eclipse.collections.api.RichIterable.reject.

Same as the reject method with one parameter but uses the specified target collection for the results.

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

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.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 boolean
remove(Object object)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.remove.

Implements java.util.Collection.remove, java.util.List.remove.

Removes the first occurrence of the specified element from this list, if it is present (optional operation).

public E
remove(int index)

Implements java.util.List.remove.

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

public boolean
removeAll(Collection<?> collection)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.removeAll.

Implements java.util.Collection.removeAll, java.util.List.removeAll.

Removes from this list all of its elements that are contained in the specified collection (optional operation).

public void
replaceAll(UnaryOperator<E> 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 void
public boolean
retainAll(Collection<?> collection)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.retainAll.

Implements java.util.Collection.retainAll, java.util.List.retainAll.

Retains only the elements in this list that are contained in the specified collection (optional operation).

public void
reverseForEach(Procedure<? super E> procedure)

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

Evaluates the procedure for each element of the list iterating in reverse order.

public void
reverseForEachWithIndex(ObjectIntProcedure<? super E> procedure)

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

Evaluates the procedure for each element and it's index in reverse order.

public CompositeFastList<E>
reverseThis()

Overrides default org.eclipse.collections.api.list.MutableList.reverseThis.

Mutates this list by reversing its order and returns the current list as a result.

public <R extends Collection<E>> R
select(Predicate<? super E> predicate, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.select.

Implements org.eclipse.collections.api.RichIterable.select.

Same as the select method with one parameter but uses the specified target collection for the results.

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

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.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 E
set(int index, E element)

Implements java.util.List.set.

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

public int
public void
sort(Comparator<? super E> comparator)

Overrides default java.util.List.sort.

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

public Object[]
toArray()

Overrides default org.eclipse.collections.api.list.MutableList.toArray, org.eclipse.collections.api.collection.MutableCollection.toArray, org.eclipse.collections.api.RichIterable.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

public Object[]
toArray(Object[] array)

Overrides default org.eclipse.collections.api.list.MutableList.toArray, org.eclipse.collections.api.collection.MutableCollection.toArray, org.eclipse.collections.api.RichIterable.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.

Inherited from org.eclipse.collections.impl.list.mutable.AbstractMutableList:
appendStringappendStringasReversedasSynchronizedasUnmodifiablebinarySearchchunkcollectIfcorrespondsdetectdetectIndexdetectLastIndexdetectOptionaldetectWithdetectWithOptionaldistinctdistinctdistinctBydropdropWhileequalsflatCollectforEachforEachWithIndexgetFirstgetLastgroupBygroupByEachgroupByUniqueKeyhashCodeinjectIntoWithmaxmaxmaxByminminminBynewEmptypartitionpartitionWhilepartitionWithremoveIfremoveIfWithremoveRangeselectAndRejectWithselectInstancesOfsortThisByBooleansortThisByBytesortThisByCharsortThisByDoublesortThisByFloatsortThisByIntsortThisByLongsortThisByShortsubListsubListRangeChecksumOfDoublesumOfFloatsumOfIntsumOfLongtaketakeWhiletaptoSettoSortedListzipzipzipWithIndexzipWithIndex