Class CompositeFastList<E>
java.lang.Object
org.eclipse.collections.impl.AbstractRichIterable<T>
org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection<T>
org.eclipse.collections.impl.list.mutable.AbstractMutableList<E>
org.eclipse.collections.impl.list.mutable.CompositeFastList<E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,List<E>,MutableCollection<E>,InternalIterable<E>,ListIterable<E>,MutableList<E>,OrderedIterable<E>,ReversibleIterable<E>,RichIterable<E>,BatchIterable<E>
public final class CompositeFastList<E>
extends AbstractMutableList<E>
implements BatchIterable<E>, Serializable
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)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends E> collection) booleanaddAll(Collection<? extends E> collection) voidaddComposited(Collection<? extends E> collection) booleanallSatisfy(Predicate<? super E> predicate) <P> booleanallSatisfyWith(Predicate2<? super E, ? super P> predicate, P parameter) booleananySatisfy(Predicate<? super E> predicate) <P> booleananySatisfyWith(Predicate2<? super E, ? super P> predicate, P parameter) asParallel(ExecutorService executorService, int batchSize) voidbatchForEach(Procedure<? super E> procedure, int sectionIndex, int sectionCount) voidclear()clone()<V,R extends Collection<V>>
R<P,A, R extends Collection<A>>
RcollectWith(Function2<? super E, ? super P, ? extends A> function, P parameter, R target) booleanbooleancontainsAll(Collection<?> collection) int<P> intcountWith(Predicate2<? super E, ? super P> predicate, P parameter) void<P> voidforEachWith(Procedure2<? super E, ? super P> procedure2, P parameter) voidforEachWithIndex(ObjectIntProcedure<? super E> objectIntProcedure) get(int index) intgetBatchCount(int batchSize) intdoubleinjectInto(double injectedValue, DoubleObjectToDoubleFunction<? super E> function) floatinjectInto(float injectedValue, FloatObjectToFloatFunction<? super E> function) intinjectInto(int injectedValue, IntObjectToIntFunction<? super E> function) longinjectInto(long injectedValue, LongObjectToLongFunction<? super E> function) <IV> IVinjectInto(IV injectedValue, Function2<? super IV, ? super E, ? extends IV> function) booleanisEmpty()iterator()inta 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).listIterator(int index) 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).booleannoneSatisfy(Predicate<? super E> predicate) <P> booleannoneSatisfyWith(Predicate2<? super E, ? super P> predicate, P parameter) <R extends Collection<E>>
R<P,R extends Collection<E>>
RrejectWith(Predicate2<? super E, ? super P> predicate, P parameter, R target) remove(int index) booleanbooleanremoveAll(Collection<?> collection) voidreplaceAll(UnaryOperator<E> operator) voidbooleanretainAll(Collection<?> collection) voidreverseForEach(Procedure<? super E> procedure) voidreverseForEachWithIndex(ObjectIntProcedure<? super E> procedure) <R extends Collection<E>>
R<P,R extends Collection<E>>
RselectWith(Predicate2<? super E, ? super P> predicate, P parameter, R target) intsize()voidsort(Comparator<? super E> comparator) Object[]toArray()Object[]Methods inherited from class org.eclipse.collections.impl.list.mutable.AbstractMutableList
appendString, appendString, asReversed, asSynchronized, asUnmodifiable, binarySearch, chunk, collectIf, corresponds, detect, detectIndex, detectLastIndex, detectOptional, detectWith, detectWithOptional, distinct, distinct, distinctBy, drop, dropWhile, equals, flatCollect, forEach, forEachWithIndex, getFirst, getLast, groupBy, groupByEach, groupByUniqueKey, hashCode, injectIntoWith, max, max, maxBy, min, min, minBy, newEmpty, partition, partitionWhile, partitionWith, removeIf, removeIfWith, selectAndRejectWith, selectInstancesOf, sortThisByBoolean, sortThisByByte, sortThisByChar, sortThisByDouble, sortThisByFloat, sortThisByInt, sortThisByLong, sortThisByShort, subList, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, take, takeWhile, tap, toSet, toSortedList, zip, zip, zipWithIndex, zipWithIndexMethods inherited from class org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection
addAllIterable, countBy, countByEach, countByWith, reduce, removeAllIterable, retainAllIterable, sumByDouble, sumByFloat, sumByInt, sumByLongMethods inherited from class org.eclipse.collections.impl.AbstractRichIterable
asLazy, containsAllArguments, containsAllIterable, detectWithIfNone, forEach, groupBy, groupByEach, groupByUniqueKey, into, toBag, toBiMap, toList, toMap, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toStringMethods inherited from interface org.eclipse.collections.impl.parallel.BatchIterable
forEachMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface org.eclipse.collections.api.InternalIterable
forEachMethods inherited from interface java.util.List
spliteratorMethods inherited from interface org.eclipse.collections.api.list.ListIterable
binarySearch, forEachInBothMethods inherited from interface org.eclipse.collections.api.collection.MutableCollection
addAllIterable, aggregateBy, aggregateInPlaceBy, countBy, countByEach, countByWith, removeAllIterable, retainAllIterable, sumByDouble, sumByFloat, sumByInt, sumByLongMethods inherited from interface org.eclipse.collections.api.list.MutableList
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, collectWithIndex, flatCollect, flatCollectWith, reject, rejectWith, rejectWithIndex, select, selectWith, selectWithIndex, shuffleThis, shuffleThis, sortThis, sortThis, sortThisBy, toImmutable, toImmutableList, toReversed, with, withAll, without, withoutAllMethods inherited from interface org.eclipse.collections.api.ordered.OrderedIterable
collectWithIndex, getFirstOptional, getLastOptional, rejectWithIndex, selectWithIndex, toStackMethods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, appendString, asLazy, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, countBy, countByEach, countByWith, detectIfNone, detectWithIfNone, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, makeString, makeString, makeString, makeString, maxByOptional, maxOptional, maxOptional, minByOptional, minOptional, minOptional, notEmpty, reduce, reduceBy, reduceBy, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString
-
Constructor Details
-
CompositeFastList
public CompositeFastList()
-
-
Method Details
-
clone
- Specified by:
clonein interfaceMutableList<E>- Overrides:
clonein classAbstractMutableList<E>
-
size
public int size()- Specified by:
sizein interfaceBatchIterable<E>- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein interfaceRichIterable<E>
-
resetSize
public void resetSize() -
batchForEach
- Specified by:
batchForEachin interfaceBatchIterable<E>
-
getBatchCount
public int getBatchCount(int batchSize) - Specified by:
getBatchCountin interfaceBatchIterable<E>
-
reverseThis
- Specified by:
reverseThisin interfaceMutableList<E>
-
each
- Specified by:
eachin interfaceRichIterable<E>- Overrides:
eachin classAbstractMutableList<E>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractMutableList<E>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractMutableList<E>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractMutableList<E>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractMutableList<E>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractRichIterable<E>
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceInternalIterable<E>- Specified by:
forEachWithIndexin interfaceOrderedIterable<E>- Overrides:
forEachWithIndexin classAbstractMutableList<E>
-
reverseForEach
- Specified by:
reverseForEachin interfaceReversibleIterable<E>
-
reverseForEachWithIndex
- Specified by:
reverseForEachWithIndexin interfaceReversibleIterable<E>
-
forEachWith
- Specified by:
forEachWithin interfaceInternalIterable<E>- Overrides:
forEachWithin classAbstractMutableList<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceList<E>- Specified by:
isEmptyin interfaceRichIterable<E>- Overrides:
isEmptyin classAbstractRichIterable<E>
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceList<E>- Specified by:
containsin interfaceRichIterable<E>- Overrides:
containsin classAbstractMutableList<E>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceList<E>- Specified by:
toArrayin interfaceMutableCollection<E>- Specified by:
toArrayin interfaceMutableList<E>- Specified by:
toArrayin interfaceRichIterable<E>
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceList<E>- Overrides:
addin classAbstractMutableCollection<E>
-
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceList<E>- Overrides:
removein classAbstractMutableCollection<E>
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceList<E>- Overrides:
addAllin classAbstractMutableCollection<E>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>- Specified by:
containsAllin interfaceRichIterable<E>- Overrides:
containsAllin classAbstractMutableList<E>
-
toArray
- Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceList<E>- Specified by:
toArrayin interfaceMutableCollection<E>- Specified by:
toArrayin interfaceMutableList<E>- Specified by:
toArrayin interfaceRichIterable<E>
-
addComposited
-
addAll
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>- Overrides:
clearin classAbstractMutableList<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceList<E>- Overrides:
retainAllin classAbstractMutableList<E>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceList<E>- Overrides:
removeAllin classAbstractMutableList<E>
-
get
-
set
-
add
-
remove
-
indexOf
- Specified by:
indexOfin interfaceList<E>- Specified by:
indexOfin interfaceMutableList<E>- Specified by:
indexOfin interfaceOrderedIterable<E>- Overrides:
indexOfin classAbstractMutableList<E>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<E>- Specified by:
lastIndexOfin interfaceListIterable<E>- Overrides:
lastIndexOfin classAbstractMutableList<E>
-
replaceAll
- Specified by:
replaceAllin interfaceList<E>- Since:
- 10.0
-
sort
-
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). Convert the internal lists to one list (if not already just one list) and return that list's list iterator.AFAIK list iterator is only commonly used in sorting.
- Specified by:
listIteratorin interfaceList<E>- Specified by:
listIteratorin interfaceListIterable<E>- Overrides:
listIteratorin classAbstractMutableList<E>- Returns:
- a ListIterator for this, with internal state converted to one list if needed.
-
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). Convert the internal lists to one list (if not already just one list) and return that list's list iterator.AFAIK list iterator is only commonly used in sorting.
- Specified by:
listIteratorin interfaceList<E>- Specified by:
listIteratorin interfaceListIterable<E>- Overrides:
listIteratorin classAbstractMutableList<E>- Returns:
- a ListIterator for this, with internal state converted to one list if needed.
-
count
- Specified by:
countin interfaceRichIterable<E>- Overrides:
countin classAbstractMutableList<E>
-
countWith
- Specified by:
countWithin interfaceRichIterable<E>- Overrides:
countWithin classAbstractMutableList<E>
-
anySatisfy
- Specified by:
anySatisfyin interfaceRichIterable<E>- Overrides:
anySatisfyin classAbstractMutableList<E>
-
select
- Specified by:
selectin interfaceRichIterable<E>- Overrides:
selectin classAbstractMutableList<E>
-
selectWith
public <P,R extends Collection<E>> R selectWith(Predicate2<? super E, ? super P> predicate, P parameter, R target) - Specified by:
selectWithin interfaceRichIterable<E>- Overrides:
selectWithin classAbstractMutableList<E>
-
reject
- Specified by:
rejectin interfaceRichIterable<E>- Overrides:
rejectin classAbstractMutableList<E>
-
rejectWith
public <P,R extends Collection<E>> R rejectWith(Predicate2<? super E, ? super P> predicate, P parameter, R target) - Specified by:
rejectWithin interfaceRichIterable<E>- Overrides:
rejectWithin classAbstractMutableList<E>
-
collect
- Specified by:
collectin interfaceRichIterable<E>- Overrides:
collectin classAbstractMutableList<E>
-
collectWith
public <P,A, R collectWithR extends Collection<A>> (Function2<? super E, ? super P, ? extends A> function, P parameter, R target) - Specified by:
collectWithin interfaceRichIterable<E>- Overrides:
collectWithin classAbstractMutableList<E>
-
anySatisfyWith
- Specified by:
anySatisfyWithin interfaceRichIterable<E>- Overrides:
anySatisfyWithin classAbstractMutableList<E>
-
allSatisfy
- Specified by:
allSatisfyin interfaceRichIterable<E>- Overrides:
allSatisfyin classAbstractMutableList<E>
-
allSatisfyWith
- Specified by:
allSatisfyWithin interfaceRichIterable<E>- Overrides:
allSatisfyWithin classAbstractMutableList<E>
-
noneSatisfy
- Specified by:
noneSatisfyin interfaceRichIterable<E>- Overrides:
noneSatisfyin classAbstractMutableList<E>
-
noneSatisfyWith
- Specified by:
noneSatisfyWithin interfaceRichIterable<E>- Overrides:
noneSatisfyWithin classAbstractMutableList<E>
-
asParallel
- Specified by:
asParallelin interfaceListIterable<E>- Overrides:
asParallelin classAbstractMutableList<E>
-