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:
java.lang.Iterable<T>
,java.util.Collection<T>
,Bag<T>
,ImmutableBagIterable<T>
,ImmutableCollection<T>
,InternalIterable<T>
,RichIterable<T>
- Direct Known Subclasses:
AbstractImmutableBag
,AbstractImmutableSortedBag
public abstract class AbstractImmutableBagIterable<T> extends AbstractBag<T> implements ImmutableBagIterable<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractImmutableBagIterable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(T t)
boolean
addAll(java.util.Collection<? extends T> collection)
java.util.Collection<T>
castToCollection()
This can be overridden in most implementations to just return this.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 java.lang.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.java.util.stream.Stream<T>
parallelStream()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> collection)
protected void
removeAllFrom(java.lang.Iterable<? extends T> elements, MutableCollection<T> result)
boolean
retainAll(java.util.Collection<?> collection)
protected boolean
shortCircuit(T[] elements, int[] occurrences, ObjectIntPredicate<? super T> predicate, boolean expected, boolean onShortCircuit, boolean atEnd)
java.util.Spliterator<T>
spliterator()
java.util.stream.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, occurrencesSortingBy, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toList, toListWithOccurrences, toSet, toSortedBag, toSortedBag, toSortedList, toSortedSet, toSortedSet, toStringOfItemToCount
-
Methods 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, zipWithIndex
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.bag.Bag
aggregateBy, allSatisfyWithOccurrences, anySatisfyWithOccurrences, bottomOccurrences, collectWithOccurrences, detectWithOccurrences, distinctView, equals, forEachWithOccurrences, hashCode, noneSatisfyWithOccurrences, occurrencesOf, reduceInPlace, reduceInPlace, sizeDistinct, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toImmutable, topOccurrences, toStringOfItemToCount
-
Methods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, isEmpty, iterator, removeIf, size, toArray, toArray, toArray
-
Methods inherited from interface org.eclipse.collections.api.bag.ImmutableBagIterable
collectWithOccurrences, groupBy, groupByEach, partition, partitionWith, reject, rejectWith, select, selectByOccurrences, selectDuplicates, selectInstancesOf, selectUnique, selectWith, tap, toMapOfItemToCount, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.collection.ImmutableCollection
aggregateBy, aggregateInPlaceBy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, flatCollect, flatCollectWith, groupByUniqueKey, newWith, newWithAll, newWithout, newWithoutAll, zip
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods 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, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, 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, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, 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, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
-
-
-
-
Method Detail
-
sumByInt
public <V> ImmutableObjectLongMap<V> sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
Description copied from interface:RichIterable
Groups and sums the values using the two specified functions.- Specified by:
sumByInt
in interfaceImmutableCollection<T>
- Specified by:
sumByInt
in interfaceRichIterable<T>
-
sumByFloat
public <V> ImmutableObjectDoubleMap<V> sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
Description copied from interface:RichIterable
Groups and sums the values using the two specified functions.- Specified by:
sumByFloat
in interfaceImmutableCollection<T>
- Specified by:
sumByFloat
in interfaceRichIterable<T>
-
sumByLong
public <V> ImmutableObjectLongMap<V> sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
Description copied from interface:RichIterable
Groups and sums the values using the two specified functions.- Specified by:
sumByLong
in interfaceImmutableCollection<T>
- Specified by:
sumByLong
in interfaceRichIterable<T>
-
sumByDouble
public <V> ImmutableObjectDoubleMap<V> sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
Description copied from interface:RichIterable
Groups and sums the values using the two specified functions.- Specified by:
sumByDouble
in interfaceImmutableCollection<T>
- Specified by:
sumByDouble
in interfaceRichIterable<T>
-
removeAllFrom
protected void removeAllFrom(java.lang.Iterable<? extends T> elements, MutableCollection<T> result)
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<T>
-
addAll
public boolean addAll(java.util.Collection<? extends T> collection)
- Specified by:
addAll
in interfacejava.util.Collection<T>
-
removeAll
public boolean removeAll(java.util.Collection<?> collection)
- Specified by:
removeAll
in interfacejava.util.Collection<T>
-
retainAll
public boolean retainAll(java.util.Collection<?> collection)
- Specified by:
retainAll
in interfacejava.util.Collection<T>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<T>
-
countBy
public <V> ImmutableBag<V> countBy(Function<? super T,? extends V> function)
Description copied from interface:RichIterable
This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.- Specified by:
countBy
in interfaceImmutableCollection<T>
- Specified by:
countBy
in 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:RichIterable
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.- Specified by:
countByWith
in interfaceImmutableCollection<T>
- Specified by:
countByWith
in interfaceRichIterable<T>
- Since:
- 9.0
-
countByEach
public <V> ImmutableBag<V> countByEach(Function<? super T,? extends java.lang.Iterable<V>> function)
Description copied from interface:RichIterable
This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.- Specified by:
countByEach
in interfaceImmutableCollection<T>
- Specified by:
countByEach
in interfaceRichIterable<T>
- Overrides:
countByEach
in classAbstractRichIterable<T>
- Since:
- 10.0.0
-
stream
public java.util.stream.Stream<T> stream()
- Specified by:
stream
in interfacejava.util.Collection<T>
- Specified by:
stream
in interfaceImmutableCollection<T>
- Since:
- 9.0
-
parallelStream
public java.util.stream.Stream<T> parallelStream()
- Specified by:
parallelStream
in interfacejava.util.Collection<T>
- Specified by:
parallelStream
in interfaceImmutableCollection<T>
- Since:
- 9.0
-
spliterator
public java.util.Spliterator<T> spliterator()
- Specified by:
spliterator
in interfacejava.util.Collection<T>
- Specified by:
spliterator
in interfaceImmutableCollection<T>
- Specified by:
spliterator
in interfacejava.lang.Iterable<T>
- Since:
- 9.0
-
castToCollection
public java.util.Collection<T> castToCollection()
Description copied from interface:ImmutableCollection
This can be overridden in most implementations to just return this.- Specified by:
castToCollection
in interfaceImmutableCollection<T>
- Since:
- 9.0
-
shortCircuit
protected boolean shortCircuit(T[] elements, int[] occurrences, ObjectIntPredicate<? super T> predicate, boolean expected, boolean onShortCircuit, boolean atEnd)
-
-