Class 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>
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) Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty.<P> booleanallSatisfyWith(Predicate2<? super E, ? super P> predicate, P parameter) Returns true if the predicate evaluates to true for every element of the collection, or returns false.booleananySatisfy(Predicate<? super E> predicate) Returns true if the predicate evaluates to true for any element of the iterable.<P> booleananySatisfyWith(Predicate2<? super E, ? super P> predicate, P parameter) Returns true if the predicate evaluates to true for any element of the collection, or return false.asParallel(ExecutorService executorService, int batchSize) Returns a parallel iterable of this ListIterable.voidbatchForEach(Procedure<? super E> procedure, int sectionIndex, int sectionCount) voidclear()clone()<V,R extends Collection<V>>
RSame asRichIterable.collect(Function), except that the results are gathered into the specifiedtargetcollection.<P,A, R extends Collection<A>>
RcollectWith(Function2<? super E, ? super P, ? extends A> function, P parameter, R target) Same as collectWith but with a targetCollection parameter to gather the results.booleanReturns true if the iterable has an element which responds true to element.equals(object).booleancontainsAll(Collection<?> collection) Returns true if all elements in source are contained in this collection.intReturn the total number of elements that answer true to the specified predicate.<P> intcountWith(Predicate2<? super E, ? super P> predicate, P parameter) Returns the total number of elements that evaluate to true for the specified predicate.voidThe procedure is executed for each element in the iterable.<P> voidforEachWith(Procedure2<? super E, ? super P> procedure2, P parameter) The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.voidforEachWithIndex(ObjectIntProcedure<? super E> objectIntProcedure) Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.get(int index) Returns the item at the specified position in this list iterable.intgetBatchCount(int batchSize) intReturns the index of the first occurrence of the specified item in this iterable, or -1 if this iterable does not contain the item.doubleinjectInto(double injectedValue, DoubleObjectToDoubleFunction<? super E> function) Returns the final double result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.floatinjectInto(float injectedValue, FloatObjectToFloatFunction<? super E> function) Returns the final float result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.intinjectInto(int injectedValue, IntObjectToIntFunction<? super E> function) Returns the final int result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.longinjectInto(long injectedValue, LongObjectToLongFunction<? super E> function) Returns the final long result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.<IV> IVinjectInto(IV injectedValue, Function2<? super IV, ? super E, ? extends IV> function) Returns the final result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.booleanisEmpty()Returns true if this iterable has zero items.iterator()intReturns the index of the last occurrence of the specified item in this list, or -1 if this list does not contain the item.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).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) Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty.<P> booleannoneSatisfyWith(Predicate2<? super E, ? super P> predicate, P parameter) Returns true if the predicate evaluates to false for every element of the collection, or return false.<R extends Collection<E>>
RSame as the reject method with one parameter but uses the specified target collection for the results.<P,R extends Collection<E>>
RrejectWith(Predicate2<? super E, ? super P> predicate, P parameter, R target) Similar toRichIterable.reject(Predicate, Collection), except with an evaluation parameter for the second generic argument inPredicate2.remove(int index) booleanbooleanremoveAll(Collection<?> collection) voidreplaceAll(UnaryOperator<E> operator) voidbooleanretainAll(Collection<?> collection) voidreverseForEach(Procedure<? super E> procedure) Evaluates the procedure for each element of the list iterating in reverse order.voidreverseForEachWithIndex(ObjectIntProcedure<? super E> procedure) Evaluates the procedure for each element and it's index in reverse order.Mutates this list by reversing its order and returns the current list as a result.<R extends Collection<E>>
RSame as the select method with one parameter but uses the specified target collection for the results.<P,R extends Collection<E>>
RselectWith(Predicate2<? super E, ? super P> predicate, P parameter, R target) Similar toRichIterable.select(Predicate, Collection), except with an evaluation parameter for the second generic argument inPredicate2.intsize()Returns the number of items in this iterable.voidsort(Comparator<? super E> comparator) Object[]toArray()Converts this iterable to an array.Object[]Converts this iterable to an array using the specified target array, assuming the target array is as long or longer than the iterable.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, 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()Description copied from interface:RichIterableReturns the number of items in this iterable.- 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
Description copied from interface:MutableListMutates this list by reversing its order and returns the current list as a result.- Specified by:
reverseThisin interfaceMutableList<E>
-
each
Description copied from interface:RichIterableThe procedure is executed for each element in the iterable.Example using a Java 8 lambda expression:
people.each(person -> LOGGER.info(person.getName()));
Example using an anonymous inner class:
people.each(new Procedure<Person>() { public void value(Person person) { LOGGER.info(person.getName()); } });This method is a variant ofInternalIterable.forEach(Procedure)that has a signature conflict withIterable.forEach(java.util.function.Consumer).- Specified by:
eachin interfaceRichIterable<E>- Overrides:
eachin classAbstractMutableList<E>- See Also:
-
injectInto
Description copied from interface:RichIterableReturns the final result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter. This method is commonly called fold or sometimes reduce.- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractMutableList<E>
-
injectInto
Description copied from interface:RichIterableReturns the final int result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractMutableList<E>
-
injectInto
Description copied from interface:RichIterableReturns the final float result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractMutableList<E>
-
injectInto
Description copied from interface:RichIterableReturns the final long result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractMutableList<E>
-
injectInto
Description copied from interface:RichIterableReturns the final double result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Specified by:
injectIntoin interfaceRichIterable<E>- Overrides:
injectIntoin classAbstractRichIterable<E>
-
forEachWithIndex
Description copied from interface:InternalIterableIterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.Example using a Java 8 lambda:
people.forEachWithIndex((Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));Example using an anonymous inner class:
people.forEachWithIndex(new ObjectIntProcedure<Person>() { public void value(Person person, int index) { LOGGER.info("Index: " + index + " person: " + person.getName()); } });- Specified by:
forEachWithIndexin interfaceInternalIterable<E>- Specified by:
forEachWithIndexin interfaceOrderedIterable<E>- Overrides:
forEachWithIndexin classAbstractMutableList<E>
-
reverseForEach
Description copied from interface:ReversibleIterableEvaluates the procedure for each element of the list iterating in reverse order.e.g. people.reverseForEach(person -> LOGGER.info(person.getName()));
- Specified by:
reverseForEachin interfaceReversibleIterable<E>
-
reverseForEachWithIndex
Description copied from interface:ReversibleIterableEvaluates the procedure for each element and it's index in reverse order.e.g. people.reverseForEachWithIndex((person, index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));- Specified by:
reverseForEachWithIndexin interfaceReversibleIterable<E>
-
forEachWith
Description copied from interface:InternalIterableThe procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.Example using a Java 8 lambda:
people.forEachWith((Person person, Person other) -> { if (person.isRelatedTo(other)) { LOGGER.info(person.getName()); } }, fred);Example using an anonymous inner class:
people.forEachWith(new Procedure2<Person, Person>() { public void value(Person person, Person other) { if (person.isRelatedTo(other)) { LOGGER.info(person.getName()); } } }, fred);- Specified by:
forEachWithin interfaceInternalIterable<E>- Overrides:
forEachWithin classAbstractMutableList<E>
-
isEmpty
public boolean isEmpty()Description copied from interface:RichIterableReturns true if this iterable has zero items.- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceList<E>- Specified by:
isEmptyin interfaceRichIterable<E>- Overrides:
isEmptyin classAbstractRichIterable<E>
-
contains
Description copied from interface:RichIterableReturns true if the iterable has an element which responds true to element.equals(object).- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceList<E>- Specified by:
containsin interfaceRichIterable<E>- Overrides:
containsin classAbstractMutableList<E>
-
iterator
-
toArray
Description copied from interface:RichIterableConverts this iterable to an array.- Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceList<E>- Specified by:
toArrayin interfaceRichIterable<E>- Overrides:
toArrayin classAbstractRichIterable<E>- See Also:
-
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
Description copied from interface:RichIterableReturns true if all elements in source are contained in this collection.- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>- Specified by:
containsAllin interfaceRichIterable<E>- Overrides:
containsAllin classAbstractMutableList<E>- See Also:
-
toArray
Description copied from interface:RichIterableConverts this iterable to an array using the specified target array, assuming the target array is as long or longer than the iterable.- Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceList<E>- Specified by:
toArrayin interfaceRichIterable<E>- Overrides:
toArrayin classAbstractRichIterable<E>- See Also:
-
addComposited
-
addAll
-
clear
public void clear() -
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
Description copied from interface:ListIterableReturns the item at the specified position in this list iterable. -
set
-
add
-
remove
-
indexOf
Description copied from interface:OrderedIterableReturns the index of the first occurrence of the specified item in this iterable, or -1 if this iterable does not contain the item.- Specified by:
indexOfin interfaceList<E>- Specified by:
indexOfin interfaceOrderedIterable<E>- Overrides:
indexOfin classAbstractMutableList<E>- See Also:
-
lastIndexOf
Description copied from interface:ListIterableReturns the index of the last occurrence of the specified item in this list, or -1 if this list does not contain the item.- 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.
- See Also:
-
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.
- See Also:
-
count
Description copied from interface:RichIterableReturn the total number of elements that answer true to the specified predicate.Example using a Java 8 lambda expression:
int count = people.count(person -> person.getAddress().getState().getName().equals("New York"));Example using an anonymous inner class:
int count = people.count(new Predicate<Person>() { public boolean accept(Person person) { return person.getAddress().getState().getName().equals("New York"); } });- Specified by:
countin interfaceRichIterable<E>- Overrides:
countin classAbstractMutableList<E>
-
countWith
Description copied from interface:RichIterableReturns the total number of elements that evaluate to true for the specified predicate.e.g. return lastNames.countWith(Predicates2.equal(), "Smith");
- Specified by:
countWithin interfaceRichIterable<E>- Overrides:
countWithin classAbstractMutableList<E>
-
anySatisfy
Description copied from interface:RichIterableReturns true if the predicate evaluates to true for any element of the iterable. Returns false if the iterable is empty, or if no element returned true when evaluating the predicate.- Specified by:
anySatisfyin interfaceRichIterable<E>- Overrides:
anySatisfyin classAbstractMutableList<E>
-
select
Description copied from interface:RichIterableSame as the select method with one parameter but uses the specified target collection for the results.Example using a Java 8 lambda expression:
MutableList<Person> selected = people.select(person -> person.person.getLastName().equals("Smith"), Lists.mutable.empty());Example using an anonymous inner class:
MutableList<Person> selected = people.select(new Predicate<Person>() { public boolean accept(Person person) { return person.person.getLastName().equals("Smith"); } }, Lists.mutable.empty());- Specified by:
selectin interfaceRichIterable<E>- Overrides:
selectin classAbstractMutableList<E>- Parameters:
predicate- aPredicateto use as the select criteriatarget- the Collection to append to for all elements in thisRichIterablethat meet select criteriapredicate- Returns:
target, which contains appended elements as a result of the select criteria- See Also:
-
selectWith
public <P,R extends Collection<E>> R selectWith(Predicate2<? super E, ? super P> predicate, P parameter, R target) Description copied from interface:RichIterableSimilar toRichIterable.select(Predicate, Collection), except with an evaluation parameter for the second generic argument inPredicate2.E.g. return a
Collectionof Person elements where the person has an age greater than or equal to 18 yearsExample using a Java 8 lambda expression:
MutableList<Person> selected = people.selectWith((Person person, Integer age) -> person.getAge()>= age, Integer.valueOf(18), Lists.mutable.empty());Example using an anonymous inner class:
MutableList<Person> selected = people.selectWith(new Predicate2<Person, Integer>() { public boolean accept(Person person, Integer age) { return person.getAge()>= age; } }, Integer.valueOf(18), Lists.mutable.empty());- Specified by:
selectWithin interfaceRichIterable<E>- Overrides:
selectWithin classAbstractMutableList<E>- Parameters:
predicate- aPredicate2to use as the select criteriaparameter- a parameter to pass in for evaluation of the second argumentPinpredicatetarget- the Collection to append to for all elements in thisRichIterablethat meet select criteriapredicate- Returns:
targetCollection, which contains appended elements as a result of the select criteria- See Also:
-
reject
Description copied from interface:RichIterableSame as the reject method with one parameter but uses the specified target collection for the results.Example using a Java 8 lambda expression:
MutableList<Person> rejected = people.reject(person -> person.person.getLastName().equals("Smith"), Lists.mutable.empty());Example using an anonymous inner class:
MutableList<Person> rejected = people.reject(new Predicate<Person>() { public boolean accept(Person person) { return person.person.getLastName().equals("Smith"); } }, Lists.mutable.empty());- Specified by:
rejectin interfaceRichIterable<E>- Overrides:
rejectin classAbstractMutableList<E>- Parameters:
predicate- aPredicateto use as the reject criteriatarget- the Collection to append to for all elements in thisRichIterablethat causePredicate#accept(Object)method to evaluate to false- Returns:
target, which contains appended elements as a result of the reject criteria
-
rejectWith
public <P,R extends Collection<E>> R rejectWith(Predicate2<? super E, ? super P> predicate, P parameter, R target) Description copied from interface:RichIterableSimilar toRichIterable.reject(Predicate, Collection), except with an evaluation parameter for the second generic argument inPredicate2.E.g. return a
Collectionof Person elements where the person has an age greater than or equal to 18 yearsExample using a Java 8 lambda expression:
MutableList<Person> rejected = people.rejectWith((Person person, Integer age) -> person.getAge() < age, Integer.valueOf(18), Lists.mutable.empty());Example using an anonymous inner class:
MutableList<Person> rejected = people.rejectWith(new Predicate2<Person, Integer>() { public boolean accept(Person person, Integer age) { return person.getAge() < age; } }, Integer.valueOf(18), Lists.mutable.empty());- Specified by:
rejectWithin interfaceRichIterable<E>- Overrides:
rejectWithin classAbstractMutableList<E>- Parameters:
predicate- aPredicate2to use as the reject criteriaparameter- a parameter to pass in for evaluation of the second argumentPinpredicatetarget- the Collection to append to for all elements in thisRichIterablethat causePredicate#accept(Object)method to evaluate to false- Returns:
targetCollection, which contains appended elements as a result of the reject criteria- See Also:
-
collect
Description copied from interface:RichIterableSame asRichIterable.collect(Function), except that the results are gathered into the specifiedtargetcollection.Example using a Java 8 lambda expression:
MutableList<String> names = people.collect(person -> person.getFirstName() + " " + person.getLastName(), Lists.mutable.empty());Example using an anonymous inner class:
MutableList<String> names = people.collect(new Function<Person, String>() { public String valueOf(Person person) { return person.getFirstName() + " " + person.getLastName(); } }, Lists.mutable.empty());- Specified by:
collectin interfaceRichIterable<E>- Overrides:
collectin classAbstractMutableList<E>- Parameters:
function- aFunctionto use as the collect transformation functiontarget- the Collection to append to for all elements in thisRichIterablethat meet select criteriafunction- Returns:
target, which contains appended elements as a result of the collect transformation- See Also:
-
collectWith
public <P,A, R collectWithR extends Collection<A>> (Function2<? super E, ? super P, ? extends A> function, P parameter, R target) Description copied from interface:RichIterableSame as collectWith but with a targetCollection parameter to gather the results.Example using a Java 8 lambda expression:
MutableSet<Integer> integers = Lists.mutable.with(1, 2, 3).collectWith((each, parameter) -> each + parameter, Integer.valueOf(1), Sets.mutable.empty());Example using an anonymous inner class:
Function2<Integer, Integer, Integer> addParameterFunction = new Function2<Integer, Integer, Integer>() { public Integer value(final Integer each, final Integer parameter) { return each + parameter; } }; MutableSet<Integer> integers = Lists.mutable.with(1, 2, 3).collectWith(addParameterFunction, Integer.valueOf(1), Sets.mutable.empty());- Specified by:
collectWithin interfaceRichIterable<E>- Overrides:
collectWithin classAbstractMutableList<E>- Parameters:
function- aFunction2to use as the collect transformation functionparameter- a parameter to pass in for evaluation of the second argumentPinfunctiontarget- the Collection to append to for all elements in thisRichIterablethat meet select criteriafunction- Returns:
targetCollection, which contains appended elements as a result of the collect transformation
-
anySatisfyWith
Description copied from interface:RichIterableReturns true if the predicate evaluates to true for any element of the collection, or return false. Returns false if the collection is empty.- Specified by:
anySatisfyWithin interfaceRichIterable<E>- Overrides:
anySatisfyWithin classAbstractMutableList<E>
-
allSatisfy
Description copied from interface:RichIterableReturns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty. Otherwise, returns false.- Specified by:
allSatisfyin interfaceRichIterable<E>- Overrides:
allSatisfyin classAbstractMutableList<E>
-
allSatisfyWith
Description copied from interface:RichIterableReturns true if the predicate evaluates to true for every element of the collection, or returns false.- Specified by:
allSatisfyWithin interfaceRichIterable<E>- Overrides:
allSatisfyWithin classAbstractMutableList<E>
-
noneSatisfy
Description copied from interface:RichIterableReturns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty. Otherwise, returns false.- Specified by:
noneSatisfyin interfaceRichIterable<E>- Overrides:
noneSatisfyin classAbstractMutableList<E>
-
noneSatisfyWith
Description copied from interface:RichIterableReturns true if the predicate evaluates to false for every element of the collection, or return false. Returns true if the collection is empty.- Specified by:
noneSatisfyWithin interfaceRichIterable<E>- Overrides:
noneSatisfyWithin classAbstractMutableList<E>
-
asParallel
Description copied from interface:ListIterableReturns a parallel iterable of this ListIterable.- Specified by:
asParallelin interfaceListIterable<E>- Overrides:
asParallelin classAbstractMutableList<E>
-