Class AbstractImmutableBagIterable<T>
java.lang.Object
org.eclipse.collections.impl.AbstractRichIterable<T>
org.eclipse.collections.impl.bag.AbstractBag<T>
org.eclipse.collections.impl.bag.immutable.AbstractImmutableBagIterable<T>
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Bag<T>,ImmutableBagIterable<T>,ImmutableCollection<T>,InternalIterable<T>,RichIterable<T>
- Direct Known Subclasses:
AbstractImmutableBag
public abstract class AbstractImmutableBagIterable<T> extends AbstractBag<T> implements ImmutableBagIterable<T>
-
Constructor Summary
Constructors Constructor Description AbstractImmutableBagIterable() -
Method Summary
Modifier and Type Method Description booleanadd(T t)booleanaddAll(Collection<? extends T> collection)<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.voidclear()<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.Stream<T>parallelStream()booleanremove(Object o)booleanremoveAll(Collection<?> collection)booleanretainAll(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.Methods inherited from class org.eclipse.collections.impl.bag.AbstractBag
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, count, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, groupBy, groupByEach, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoWith, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toList, toSet, toSortedBag, toSortedBag, toSortedList, toSortedSet, toSortedSet, toStringOfItemToCountMethods inherited from class org.eclipse.collections.impl.AbstractRichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, asLazy, contains, containsAll, containsAllArguments, containsAllIterable, countWith, detect, detectOptional, detectWith, detectWithIfNone, detectWithOptional, forEach, forEachWith, forEachWithIndex, groupByUniqueKey, into, isEmpty, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, toArray, toArray, toBiMap, toMap, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSetBy, toString, zip, zipWithIndexMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.collections.api.bag.Bag
aggregateBy, bottomOccurrences, collectWithOccurrences, equals, forEachWithOccurrences, hashCode, occurrencesOf, reduceInPlace, reduceInPlace, sizeDistinct, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toImmutable, topOccurrences, toStringOfItemToCountMethods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, isEmpty, iterator, removeIf, size, toArray, toArray, toArrayMethods inherited from interface org.eclipse.collections.api.bag.ImmutableBagIterable
collectWithOccurrences, groupBy, groupByEach, partition, partitionWith, reject, rejectWith, select, selectByOccurrences, selectDuplicates, selectInstancesOf, selectUnique, selectWith, tap, toMapOfItemToCount, zipWithIndexMethods inherited from interface org.eclipse.collections.api.collection.ImmutableCollection
aggregateBy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, flatCollect, flatCollectWith, groupByUniqueKey, newWith, newWithAll, newWithout, newWithoutAll, zipMethods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndexMethods inherited from interface org.eclipse.collections.api.RichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsBy, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, 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, reduce, reject, rejectWith, select, selectWith, size, 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
-
Constructor Details
-
AbstractImmutableBagIterable
public AbstractImmutableBagIterable()
-
-
Method Details
-
aggregateInPlaceBy
public <K, V> ImmutableMap<K,V> aggregateInPlaceBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator)Description copied from interface:RichIterableApplies an aggregate procedure over the iterable grouping results into a Map based on the specific groupBy function. Aggregate results are required to be mutable as they will be changed in place by the procedure. A second function specifies the initial "zero" aggregate value to work with (i.e. new AtomicInteger(0)).- Specified by:
aggregateInPlaceByin interfaceImmutableCollection<T>- Specified by:
aggregateInPlaceByin interfaceRichIterable<T>
-
sumByInt
public <V> ImmutableObjectLongMap<V> sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)Description copied from interface:RichIterableGroups and sums the values using the two specified functions.- Specified by:
sumByIntin interfaceImmutableCollection<T>- Specified by:
sumByIntin interfaceRichIterable<T>
-
sumByFloat
public <V> ImmutableObjectDoubleMap<V> sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)Description copied from interface:RichIterableGroups and sums the values using the two specified functions.- Specified by:
sumByFloatin interfaceImmutableCollection<T>- Specified by:
sumByFloatin interfaceRichIterable<T>
-
sumByLong
public <V> ImmutableObjectLongMap<V> sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)Description copied from interface:RichIterableGroups and sums the values using the two specified functions.- Specified by:
sumByLongin interfaceImmutableCollection<T>- Specified by:
sumByLongin interfaceRichIterable<T>
-
sumByDouble
public <V> ImmutableObjectDoubleMap<V> sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)Description copied from interface:RichIterableGroups and sums the values using the two specified functions.- Specified by:
sumByDoublein interfaceImmutableCollection<T>- Specified by:
sumByDoublein interfaceRichIterable<T>
-
add
- Specified by:
addin interfaceCollection<T>
-
remove
- Specified by:
removein interfaceCollection<T>
-
addAll
- Specified by:
addAllin interfaceCollection<T>
-
removeAll
- Specified by:
removeAllin interfaceCollection<T>
-
retainAll
- Specified by:
retainAllin interfaceCollection<T>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>
-
countBy
Description copied from interface:RichIterableThis method will count the number of occurrences of each value calculated by applying the function to each element of the collection.- Specified by:
countByin interfaceImmutableCollection<T>- Specified by:
countByin interfaceRichIterable<T>- Since:
- 9.0
-
countByWith
public <V, P> ImmutableBag<V> countByWith(Function2<? super T,? super P,? extends V> function, P parameter)Description copied from interface:RichIterableThis 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.- Specified by:
countByWithin interfaceImmutableCollection<T>- Specified by:
countByWithin interfaceRichIterable<T>- Since:
- 9.0
-
countByEach
Description copied from interface:RichIterableThis method will count the number of occurrences of each value calculated by applying the function to each element of the collection.- Specified by:
countByEachin interfaceImmutableCollection<T>- Specified by:
countByEachin interfaceRichIterable<T>- Overrides:
countByEachin classAbstractRichIterable<T>- Since:
- 10.0.0
-
stream
- Specified by:
streamin interfaceCollection<T>- Specified by:
streamin interfaceImmutableCollection<T>- Since:
- 9.0
-
parallelStream
- Specified by:
parallelStreamin interfaceCollection<T>- Specified by:
parallelStreamin interfaceImmutableCollection<T>- Since:
- 9.0
-
spliterator
- Specified by:
spliteratorin interfaceCollection<T>- Specified by:
spliteratorin interfaceImmutableCollection<T>- Specified by:
spliteratorin interfaceIterable<T>- Since:
- 9.0
-
castToCollection
Description copied from interface:ImmutableCollectionThis can be overridden in most implementations to just return this.- Specified by:
castToCollectionin interfaceImmutableCollection<T>- Since:
- 9.0
-