Class AbstractMutableBagIterable<T>
- java.lang.Object
-
- org.eclipse.collections.impl.AbstractRichIterable<T>
-
- org.eclipse.collections.impl.bag.AbstractBag<T>
-
- org.eclipse.collections.impl.bag.mutable.AbstractMutableBagIterable<T>
-
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,Bag<T>
,MutableBagIterable<T>
,MutableCollection<T>
,InternalIterable<T>
,RichIterable<T>
- Direct Known Subclasses:
AbstractMutableBag
,AbstractMutableSortedBag
public abstract class AbstractMutableBagIterable<T> extends AbstractBag<T> implements MutableBagIterable<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractMutableBagIterable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAll(Collection<? extends T> source)
boolean
addAllIterable(Iterable<? extends T> iterable)
boolean
allSatisfy(Predicate<? super T> predicate)
<P> boolean
allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
anySatisfy(Predicate<? super T> predicate)
<P> boolean
anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableList<ObjectIntPair<T>>
bottomOccurrences(int n)
RichIterable<RichIterable<T>>
chunk(int size)
<V> MutableBag<V>
countBy(Function<? super T,? extends V> function)
<V> MutableBag<V>
countByEach(Function<? super T,? extends Iterable<V>> function)
<V,P>
MutableBag<V>countByWith(Function2<? super T,? super P,? extends V> function, P parameter)
T
detect(Predicate<? super T> predicate)
T
detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)
Optional<T>
detectOptional(Predicate<? super T> predicate)
<P> T
detectWith(Predicate2<? super T,? super P> predicate, P parameter)
<P> T
detectWithIfNone(Predicate2<? super T,? super P> predicate, P parameter, Function0<? extends T> function)
<P> Optional<T>
detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)
T
getFirst()
T
getLast()
<V> MutableMap<V,T>
groupByUniqueKey(Function<? super T,? extends V> function)
T
max()
T
max(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
TmaxBy(Function<? super T,? extends V> function)
T
min()
T
min(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
TminBy(Function<? super T,? extends V> function)
boolean
noneSatisfy(Predicate<? super T> predicate)
<P> boolean
noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
removeAll(Collection<?> collection)
boolean
retainAll(Collection<?> collection)
boolean
retainAllIterable(Iterable<?> iterable)
<P> Twin<MutableList<T>>
selectAndRejectWith(Predicate2<? super T,? super P> predicate, P parameter)
<V> MutableObjectDoubleMap<V>
sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
<V> MutableObjectDoubleMap<V>
sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
<V> MutableObjectLongMap<V>
sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
<V> MutableObjectLongMap<V>
sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
MutableList<ObjectIntPair<T>>
topOccurrences(int n)
-
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, toStringOfItemToCount
-
Methods inherited from class org.eclipse.collections.impl.AbstractRichIterable
appendString, appendString, asLazy, contains, containsAll, containsAllArguments, containsAllIterable, countWith, forEach, forEachWith, forEachWithIndex, groupByUniqueKey, into, isEmpty, toArray, toArray, toBiMap, toMap, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSetBy, toString, zip, zipWithIndex
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.bag.Bag
aggregateBy, allSatisfyWithOccurrences, anySatisfyWithOccurrences, collectWithOccurrences, detectWithOccurrences, distinctView, equals, forEachWithOccurrences, hashCode, noneSatisfyWithOccurrences, occurrencesOf, reduceInPlace, reduceInPlace, sizeDistinct, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toImmutable, toStringOfItemToCount
-
Methods inherited from interface java.util.Collection
add, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeIf, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods inherited from interface org.eclipse.collections.api.bag.MutableBagIterable
addOccurrences, collectWithOccurrences, groupBy, groupByEach, partition, partitionWith, reject, rejectWith, removeOccurrences, select, selectByOccurrences, selectDuplicates, selectInstancesOf, selectUnique, selectWith, setOccurrences, tap, toMapOfItemToCount, with, withAll, without, withoutAll, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.collection.MutableCollection
aggregateBy, aggregateInPlaceBy, asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, flatCollect, flatCollectWith, injectIntoWith, newEmpty, removeAllIterable, removeIf, removeIfWith, toImmutable, zip
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
appendString, appendString, appendString, asLazy, 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, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, maxByOptional, maxOptional, maxOptional, minByOptional, minOptional, minOptional, 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
-
addAll
public boolean addAll(Collection<? extends T> source)
- Specified by:
addAll
in interfaceCollection<T>
-
addAllIterable
public boolean addAllIterable(Iterable<? extends T> iterable)
- Specified by:
addAllIterable
in interfaceMutableCollection<T>
-
removeAll
public boolean removeAll(Collection<?> collection)
- Specified by:
removeAll
in interfaceCollection<T>
-
retainAll
public boolean retainAll(Collection<?> collection)
- Specified by:
retainAll
in interfaceCollection<T>
-
retainAllIterable
public boolean retainAllIterable(Iterable<?> iterable)
- Specified by:
retainAllIterable
in interfaceMutableCollection<T>
-
selectAndRejectWith
public <P> Twin<MutableList<T>> selectAndRejectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
selectAndRejectWith
in interfaceMutableCollection<T>
-
getFirst
public T getFirst()
- Specified by:
getFirst
in interfaceRichIterable<T>
-
getLast
public T getLast()
- Specified by:
getLast
in interfaceRichIterable<T>
-
groupByUniqueKey
public <V> MutableMap<V,T> groupByUniqueKey(Function<? super T,? extends V> function)
- Specified by:
groupByUniqueKey
in interfaceMutableCollection<T>
- Specified by:
groupByUniqueKey
in interfaceRichIterable<T>
-
chunk
public RichIterable<RichIterable<T>> chunk(int size)
- Specified by:
chunk
in interfaceRichIterable<T>
-
detect
public T detect(Predicate<? super T> predicate)
- Specified by:
detect
in interfaceRichIterable<T>
- Overrides:
detect
in classAbstractRichIterable<T>
-
detectWith
public <P> T detectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWith
in interfaceRichIterable<T>
- Overrides:
detectWith
in classAbstractRichIterable<T>
-
detectOptional
public Optional<T> detectOptional(Predicate<? super T> predicate)
- Specified by:
detectOptional
in interfaceRichIterable<T>
- Overrides:
detectOptional
in classAbstractRichIterable<T>
-
detectWithOptional
public <P> Optional<T> detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWithOptional
in interfaceRichIterable<T>
- Overrides:
detectWithOptional
in classAbstractRichIterable<T>
-
detectIfNone
public T detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)
- Specified by:
detectIfNone
in interfaceRichIterable<T>
-
detectWithIfNone
public <P> T detectWithIfNone(Predicate2<? super T,? super P> predicate, P parameter, Function0<? extends T> function)
- Specified by:
detectWithIfNone
in interfaceRichIterable<T>
- Overrides:
detectWithIfNone
in classAbstractRichIterable<T>
-
anySatisfy
public boolean anySatisfy(Predicate<? super T> predicate)
- Specified by:
anySatisfy
in interfaceRichIterable<T>
- Overrides:
anySatisfy
in classAbstractRichIterable<T>
-
anySatisfyWith
public <P> boolean anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
anySatisfyWith
in interfaceRichIterable<T>
- Overrides:
anySatisfyWith
in classAbstractRichIterable<T>
-
allSatisfy
public boolean allSatisfy(Predicate<? super T> predicate)
- Specified by:
allSatisfy
in interfaceRichIterable<T>
- Overrides:
allSatisfy
in classAbstractRichIterable<T>
-
allSatisfyWith
public <P> boolean allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
allSatisfyWith
in interfaceRichIterable<T>
- Overrides:
allSatisfyWith
in classAbstractRichIterable<T>
-
noneSatisfy
public boolean noneSatisfy(Predicate<? super T> predicate)
- Specified by:
noneSatisfy
in interfaceRichIterable<T>
- Overrides:
noneSatisfy
in classAbstractRichIterable<T>
-
noneSatisfyWith
public <P> boolean noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
noneSatisfyWith
in interfaceRichIterable<T>
- Overrides:
noneSatisfyWith
in classAbstractRichIterable<T>
-
countBy
public <V> MutableBag<V> countBy(Function<? super T,? extends V> function)
- Specified by:
countBy
in interfaceMutableCollection<T>
- Specified by:
countBy
in interfaceRichIterable<T>
- Since:
- 9.0
-
countByWith
public <V,P> MutableBag<V> countByWith(Function2<? super T,? super P,? extends V> function, P parameter)
- Specified by:
countByWith
in interfaceMutableCollection<T>
- Specified by:
countByWith
in interfaceRichIterable<T>
- Since:
- 9.0
-
countByEach
public <V> MutableBag<V> countByEach(Function<? super T,? extends Iterable<V>> function)
- Specified by:
countByEach
in interfaceMutableCollection<T>
- Specified by:
countByEach
in interfaceRichIterable<T>
- Overrides:
countByEach
in classAbstractRichIterable<T>
- Since:
- 10.0.0
-
min
public T min()
- Specified by:
min
in interfaceRichIterable<T>
- Overrides:
min
in classAbstractRichIterable<T>
-
min
public T min(Comparator<? super T> comparator)
- Specified by:
min
in interfaceRichIterable<T>
- Overrides:
min
in classAbstractRichIterable<T>
-
minBy
public <V extends Comparable<? super V>> T minBy(Function<? super T,? extends V> function)
- Specified by:
minBy
in interfaceRichIterable<T>
- Overrides:
minBy
in classAbstractRichIterable<T>
-
max
public T max()
- Specified by:
max
in interfaceRichIterable<T>
- Overrides:
max
in classAbstractRichIterable<T>
-
max
public T max(Comparator<? super T> comparator)
- Specified by:
max
in interfaceRichIterable<T>
- Overrides:
max
in classAbstractRichIterable<T>
-
maxBy
public <V extends Comparable<? super V>> T maxBy(Function<? super T,? extends V> function)
- Specified by:
maxBy
in interfaceRichIterable<T>
- Overrides:
maxBy
in classAbstractRichIterable<T>
-
sumByInt
public <V> MutableObjectLongMap<V> sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
- Specified by:
sumByInt
in interfaceMutableCollection<T>
- Specified by:
sumByInt
in interfaceRichIterable<T>
-
sumByFloat
public <V> MutableObjectDoubleMap<V> sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
- Specified by:
sumByFloat
in interfaceMutableCollection<T>
- Specified by:
sumByFloat
in interfaceRichIterable<T>
-
sumByLong
public <V> MutableObjectLongMap<V> sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
- Specified by:
sumByLong
in interfaceMutableCollection<T>
- Specified by:
sumByLong
in interfaceRichIterable<T>
-
sumByDouble
public <V> MutableObjectDoubleMap<V> sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
- Specified by:
sumByDouble
in interfaceMutableCollection<T>
- Specified by:
sumByDouble
in interfaceRichIterable<T>
-
topOccurrences
public MutableList<ObjectIntPair<T>> topOccurrences(int n)
- Specified by:
topOccurrences
in interfaceBag<T>
- Specified by:
topOccurrences
in interfaceMutableBagIterable<T>
-
bottomOccurrences
public MutableList<ObjectIntPair<T>> bottomOccurrences(int n)
- Specified by:
bottomOccurrences
in interfaceBag<T>
- Specified by:
bottomOccurrences
in interfaceMutableBagIterable<T>
-
-