public abstract class AbstractMutableCollection<T> extends AbstractRichIterable<T> implements MutableCollection<T>
| Constructor and Description |
|---|
AbstractMutableCollection() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T element) |
boolean |
addAll(Collection<? extends T> source) |
boolean |
addAllIterable(Iterable<? extends T> iterable) |
<K,V> MutableMap<K,V> |
aggregateBy(Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Function2<? super V,? super T,? extends V> nonMutatingAggregator)
Applies an aggregate function over the iterable grouping results into a map based on the specific groupBy function.
|
<K,V> MutableMap<K,V> |
aggregateInPlaceBy(Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Procedure2<? super V,? super T> mutatingAggregator)
Applies an aggregate procedure over the iterable grouping results into a Map based on the specific groupBy function.
|
RichIterable<RichIterable<T>> |
chunk(int size)
Partitions elements in fixed size chunks.
|
<V> MutableMap<V,T> |
groupByUniqueKey(Function<? super T,? extends V> function)
For each element of the iterable, the function is evaluated and he results of these evaluations are collected
into a new map, where the transformed value is the key.
|
<IV,P> IV |
injectIntoWith(IV injectValue,
Function3<? super IV,? super T,? super P,? extends IV> function,
P parameter) |
Optional<T> |
reduce(BinaryOperator<T> accumulator)
This method produces the equivalent result as
Stream.reduce(BinaryOperator). |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> source) |
boolean |
removeAllIterable(Iterable<?> iterable) |
boolean |
removeIf(Predicate<? super T> predicate)
Removes all elements in the collection that evaluate to true for the specified predicate.
|
<P> boolean |
removeIfWith(Predicate2<? super T,? super P> predicate,
P parameter)
Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter.
|
boolean |
retainAll(Collection<?> source) |
boolean |
retainAllIterable(Iterable<?> iterable) |
<P> Twin<MutableList<T>> |
selectAndRejectWith(Predicate2<? super T,? super P> predicate,
P parameter)
Filters a collection into two separate collections based on a predicate returned via a Pair.
|
<V> MutableObjectDoubleMap<V> |
sumByDouble(Function<? super T,? extends V> groupBy,
DoubleFunction<? super T> function)
Groups and sums the values using the two specified functions.
|
<V> MutableObjectDoubleMap<V> |
sumByFloat(Function<? super T,? extends V> groupBy,
FloatFunction<? super T> function)
Groups and sums the values using the two specified functions.
|
<V> MutableObjectLongMap<V> |
sumByInt(Function<? super T,? extends V> groupBy,
IntFunction<? super T> function)
Groups and sums the values using the two specified functions.
|
<V> MutableObjectLongMap<V> |
sumByLong(Function<? super T,? extends V> groupBy,
LongFunction<? super T> function)
Groups and sums the values using the two specified functions.
|
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, flatCollect, forEach, forEachWith, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexequals, getClass, hashCode, notify, notifyAll, wait, wait, waitasSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, flatCollect, groupBy, groupByEach, newEmpty, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, tap, toImmutable, with, withAll, without, withoutAll, zip, zipWithIndexclear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeIf, size, spliterator, stream, toArray, toArrayallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, getFirst, getLast, getOnly, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexforEach, forEachWith, forEachWithIndexpublic <P> Twin<MutableList<T>> selectAndRejectWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableCollection
e.g. return lastNames.selectAndRejectWith(Predicates2.lessThan(), "Mason");
selectAndRejectWith in interface MutableCollection<T>public boolean removeIf(Predicate<? super T> predicate)
MutableCollection
e.g. return lastNames.removeIf(Predicates.isNull());
removeIf in interface MutableCollection<T>public <P> boolean removeIfWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableCollection
return lastNames.removeIfWith(Predicates2.isNull(), null);
removeIfWith in interface MutableCollection<T>public <IV,P> IV injectIntoWith(IV injectValue,
Function3<? super IV,? super T,? super P,? extends IV> function,
P parameter)
injectIntoWith in interface MutableCollection<T>public Optional<T> reduce(BinaryOperator<T> accumulator)
RichIterableStream.reduce(BinaryOperator).reduce in interface RichIterable<T>public boolean addAllIterable(Iterable<? extends T> iterable)
addAllIterable in interface MutableCollection<T>Collection.addAll(Collection)public boolean removeAllIterable(Iterable<?> iterable)
removeAllIterable in interface MutableCollection<T>Collection.removeAll(Collection)public boolean retainAllIterable(Iterable<?> iterable)
retainAllIterable in interface MutableCollection<T>Collection.retainAll(Collection)public RichIterable<RichIterable<T>> chunk(int size)
RichIterablechunk in interface RichIterable<T>size - the number of elements per chunkRichIterable containing RichIterables of size size, except the last will be
truncated if the elements don't divide evenly.public <K,V> MutableMap<K,V> aggregateInPlaceBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator)
RichIterableaggregateInPlaceBy in interface MutableCollection<T>aggregateInPlaceBy in interface RichIterable<T>public <K,V> MutableMap<K,V> aggregateBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V,? super T,? extends V> nonMutatingAggregator)
RichIterableaggregateBy in interface MutableCollection<T>aggregateBy in interface RichIterable<T>public <V> MutableObjectLongMap<V> sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
RichIterablesumByInt in interface MutableCollection<T>sumByInt in interface RichIterable<T>public <V> MutableObjectDoubleMap<V> sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
RichIterablesumByFloat in interface MutableCollection<T>sumByFloat in interface RichIterable<T>public <V> MutableObjectLongMap<V> sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
RichIterablesumByLong in interface MutableCollection<T>sumByLong in interface RichIterable<T>public <V> MutableObjectDoubleMap<V> sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
RichIterablesumByDouble in interface MutableCollection<T>sumByDouble in interface RichIterable<T>public boolean add(T element)
add in interface Collection<T>public boolean remove(Object o)
remove in interface Collection<T>public boolean addAll(Collection<? extends T> source)
addAll in interface Collection<T>public boolean removeAll(Collection<?> source)
removeAll in interface Collection<T>public boolean retainAll(Collection<?> source)
retainAll in interface Collection<T>public <V> MutableMap<V,T> groupByUniqueKey(Function<? super T,? extends V> function)
RichIterablegroupByUniqueKey in interface MutableCollection<T>groupByUniqueKey in interface RichIterable<T>RichIterable.groupBy(Function)Copyright © 2004–2017. All rights reserved.