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) |
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.
|
allSatisfy, 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, detectWith, detectWithIfNone, flatCollect, forEach, forEachWith, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, select, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
asSynchronized, 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, zipWithIndex
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeIf, size, spliterator, stream, toArray, toArray
allSatisfy, 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, detectWith, detectWithIfNone, each, flatCollect, getFirst, getLast, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, select, selectWith, size, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
forEach, forEachWith, forEachWithIndex
public <P> Twin<MutableList<T>> selectAndRejectWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableCollection
e.g. return lastNames.selectAndRejectWith(PredicatesLite.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
e.g. return lastNames.removeIfWith(PredicatesLite.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 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)
RichIterable
chunk
in interface RichIterable<T>
size
- the number of elements per chunkRichIterable
containing RichIterable
s 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)
RichIterable
aggregateInPlaceBy
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)
RichIterable
aggregateBy
in interface MutableCollection<T>
aggregateBy
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)
RichIterable
groupByUniqueKey
in interface MutableCollection<T>
groupByUniqueKey
in interface RichIterable<T>
RichIterable.groupBy(Function)
Copyright © 2004–2016. All rights reserved.