Iterable<T>
, Collection<T>
, ImmutableCollection<T>
, InternalIterable<T>
, RichIterable<T>
AbstractImmutableSet
public abstract class AbstractImmutableCollection<T> extends AbstractRichIterable<T> implements ImmutableCollection<T>, Collection<T>
Constructor | Description |
---|---|
AbstractImmutableCollection() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(T t) |
|
boolean |
addAll(Collection<? extends T> collection) |
|
<K,V> ImmutableMap<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> ImmutableMap<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.
|
Collection<T> |
castToCollection() |
This can be overridden in most implementations to just return this.
|
RichIterable<RichIterable<T>> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<V> ImmutableBag<V> |
countBy(Function<? super T,? extends V> function) |
This method will count the number of occurrences of each value calculated by applying the
function to each element of the collection.
|
<V> ImmutableBag<V> |
countByEach(Function<? super T,? extends Iterable<V>> function) |
This method will count the number of occurrences of each value calculated by applying the
function to each element of the collection.
|
<V,P> ImmutableBag<V> |
countByWith(Function2<? super T,? super P,? extends V> function,
P parameter) |
This method will count the number of occurrences of each value calculated by applying the
function to each element of the collection with the specified parameter as the second argument.
|
<V> ImmutableMap<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.
|
Stream<T> |
parallelStream() |
|
Optional<T> |
reduce(BinaryOperator<T> accumulator) |
This method produces the equivalent result as
Stream.reduce(BinaryOperator) . |
boolean |
remove(Object o) |
|
boolean |
removeAll(Collection<?> collection) |
|
boolean |
retainAll(Collection<?> collection) |
|
Spliterator<T> |
spliterator() |
|
Stream<T> |
stream() |
|
<V> ImmutableObjectDoubleMap<V> |
sumByDouble(Function<? super T,? extends V> groupBy,
DoubleFunction<? super T> function) |
Groups and sums the values using the two specified functions.
|
<V> ImmutableObjectDoubleMap<V> |
sumByFloat(Function<? super T,? extends V> groupBy,
FloatFunction<? super T> function) |
Groups and sums the values using the two specified functions.
|
<V> ImmutableObjectLongMap<V> |
sumByInt(Function<? super T,? extends V> groupBy,
IntFunction<? super T> function) |
Groups and sums the values using the two specified functions.
|
<V> ImmutableObjectLongMap<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, 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, toBiMap, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
contains, containsAll, equals, hashCode, isEmpty, iterator, removeIf, size, toArray, toArray
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, flatCollect, flatCollectWith, groupBy, groupByEach, newWith, newWithAll, newWithout, newWithoutAll, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, tap, zip, zipWithIndex
forEach, forEachWith, forEachWithIndex
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
public <K,V> ImmutableMap<K,V> aggregateInPlaceBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator)
RichIterable
aggregateInPlaceBy
in interface ImmutableCollection<T>
aggregateInPlaceBy
in interface RichIterable<T>
public <K,V> ImmutableMap<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 ImmutableCollection<T>
aggregateBy
in interface RichIterable<T>
public Optional<T> reduce(BinaryOperator<T> accumulator)
RichIterable
Stream.reduce(BinaryOperator)
.reduce
in interface RichIterable<T>
public <V> ImmutableObjectLongMap<V> sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
RichIterable
sumByInt
in interface ImmutableCollection<T>
sumByInt
in interface RichIterable<T>
public <V> ImmutableObjectDoubleMap<V> sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
RichIterable
sumByFloat
in interface ImmutableCollection<T>
sumByFloat
in interface RichIterable<T>
public <V> ImmutableObjectLongMap<V> sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
RichIterable
sumByLong
in interface ImmutableCollection<T>
sumByLong
in interface RichIterable<T>
public <V> ImmutableObjectDoubleMap<V> sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
RichIterable
sumByDouble
in interface ImmutableCollection<T>
sumByDouble
in interface RichIterable<T>
public <V> ImmutableMap<V,T> groupByUniqueKey(Function<? super T,? extends V> function)
RichIterable
groupByUniqueKey
in interface ImmutableCollection<T>
groupByUniqueKey
in interface RichIterable<T>
RichIterable.groupBy(Function)
public boolean add(T t)
add
in interface Collection<T>
public boolean remove(Object o)
remove
in interface Collection<T>
public boolean addAll(Collection<? extends T> collection)
addAll
in interface Collection<T>
public boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<T>
public boolean retainAll(Collection<?> collection)
retainAll
in interface Collection<T>
public void clear()
clear
in interface Collection<T>
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 <V> ImmutableBag<V> countBy(Function<? super T,? extends V> function)
RichIterable
countBy
in interface ImmutableCollection<T>
countBy
in interface RichIterable<T>
public <V,P> ImmutableBag<V> countByWith(Function2<? super T,? super P,? extends V> function, P parameter)
RichIterable
countByWith
in interface ImmutableCollection<T>
countByWith
in interface RichIterable<T>
public <V> ImmutableBag<V> countByEach(Function<? super T,? extends Iterable<V>> function)
RichIterable
countByEach
in interface ImmutableCollection<T>
countByEach
in interface RichIterable<T>
countByEach
in class AbstractRichIterable<T>
public Stream<T> stream()
stream
in interface Collection<T>
stream
in interface ImmutableCollection<T>
public Stream<T> parallelStream()
parallelStream
in interface Collection<T>
parallelStream
in interface ImmutableCollection<T>
public Spliterator<T> spliterator()
spliterator
in interface Collection<T>
spliterator
in interface ImmutableCollection<T>
spliterator
in interface Iterable<T>
public Collection<T> castToCollection()
ImmutableCollection
castToCollection
in interface ImmutableCollection<T>
Copyright © 2004–2019. All rights reserved.