Class AbstractMutableBag<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>
-
- org.eclipse.collections.impl.bag.mutable.AbstractMutableBag<T>
-
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Bag<T>,MutableBag<T>,MutableBagIterable<T>,UnsortedBag<T>,MutableCollection<T>,InternalIterable<T>,RichIterable<T>
- Direct Known Subclasses:
AbstractHashBag
public abstract class AbstractMutableBag<T> extends AbstractMutableBagIterable<T> implements MutableBag<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractMutableBag()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ParallelUnsortedBag<T>asParallel(ExecutorService executorService, int batchSize)SynchronizedBag<T>asSynchronized()UnmodifiableBag<T>asUnmodifiable()<V> MutableBag<V>collect(Function<? super T,? extends V> function)<V> MutableBag<V>collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)<P,V>
MutableBag<V>collectWith(Function2<? super T,? super P,? extends V> function, P parameter)<V> MutableBag<V>collectWithOccurrences(ObjectIntToObjectFunction<? super T,? extends V> function)<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)<V> MutableBag<V>flatCollect(Function<? super T,? extends Iterable<V>> function)PartitionMutableBag<T>partition(Predicate<? super T> predicate)<P> PartitionMutableBag<T>partitionWith(Predicate2<? super T,? super P> predicate, P parameter)MutableBag<T>reject(Predicate<? super T> predicate)<P> MutableBag<T>rejectWith(Predicate2<? super T,? super P> predicate, P parameter)MutableBag<T>select(Predicate<? super T> predicate)<S> MutableBag<S>selectInstancesOf(Class<S> clazz)<P> MutableBag<T>selectWith(Predicate2<? super T,? super P> predicate, P parameter)MutableBag<T>tap(Procedure<? super T> procedure)ImmutableBag<T>toImmutable()<S> MutableBag<Pair<T,S>>zip(Iterable<S> that)Deprecated.in 6.0.MutableSet<Pair<T,Integer>>zipWithIndex()Deprecated.in 6.0.-
Methods inherited from class org.eclipse.collections.impl.bag.mutable.AbstractMutableBagIterable
addAll, addAllIterable, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, bottomOccurrences, chunk, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, getFirst, getLast, groupByUniqueKey, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, removeAll, retainAll, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, topOccurrences
-
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, toStringOfItemToCount
-
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, 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.MutableBag
collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, flatCollectWith, groupBy, groupByEach, newEmpty, selectByOccurrences, selectDuplicates, selectUnique, toImmutableBag, toMapOfItemToCount, with, withAll, without, withoutAll
-
Methods inherited from interface org.eclipse.collections.api.bag.MutableBagIterable
addOccurrences, bottomOccurrences, groupBy, groupByEach, removeOccurrences, selectByOccurrences, selectDuplicates, selectUnique, setOccurrences, topOccurrences
-
Methods inherited from interface org.eclipse.collections.api.collection.MutableCollection
addAllIterable, aggregateBy, aggregateInPlaceBy, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, flatCollectWith, groupByUniqueKey, injectIntoWith, removeAllIterable, removeIf, removeIfWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLong
-
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, 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
-
toImmutable
public ImmutableBag<T> toImmutable()
- Specified by:
toImmutablein interfaceBag<T>- Specified by:
toImmutablein interfaceMutableBag<T>- Specified by:
toImmutablein interfaceMutableCollection<T>
-
asUnmodifiable
public UnmodifiableBag<T> asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableBag<T>- Specified by:
asUnmodifiablein interfaceMutableCollection<T>
-
asSynchronized
public SynchronizedBag<T> asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableBag<T>- Specified by:
asSynchronizedin interfaceMutableCollection<T>
-
tap
public MutableBag<T> tap(Procedure<? super T> procedure)
- Specified by:
tapin interfaceBag<T>- Specified by:
tapin interfaceMutableBag<T>- Specified by:
tapin interfaceMutableBagIterable<T>- Specified by:
tapin interfaceMutableCollection<T>- Specified by:
tapin interfaceRichIterable<T>- Specified by:
tapin interfaceUnsortedBag<T>
-
selectInstancesOf
public <S> MutableBag<S> selectInstancesOf(Class<S> clazz)
- Specified by:
selectInstancesOfin interfaceBag<T>- Specified by:
selectInstancesOfin interfaceMutableBag<T>- Specified by:
selectInstancesOfin interfaceMutableBagIterable<T>- Specified by:
selectInstancesOfin interfaceMutableCollection<T>- Specified by:
selectInstancesOfin interfaceRichIterable<T>- Specified by:
selectInstancesOfin interfaceUnsortedBag<T>
-
select
public MutableBag<T> select(Predicate<? super T> predicate)
- Specified by:
selectin interfaceBag<T>- Specified by:
selectin interfaceMutableBag<T>- Specified by:
selectin interfaceMutableBagIterable<T>- Specified by:
selectin interfaceMutableCollection<T>- Specified by:
selectin interfaceRichIterable<T>- Specified by:
selectin interfaceUnsortedBag<T>
-
selectWith
public <P> MutableBag<T> selectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
selectWithin interfaceBag<T>- Specified by:
selectWithin interfaceMutableBag<T>- Specified by:
selectWithin interfaceMutableBagIterable<T>- Specified by:
selectWithin interfaceMutableCollection<T>- Specified by:
selectWithin interfaceRichIterable<T>- Specified by:
selectWithin interfaceUnsortedBag<T>
-
reject
public MutableBag<T> reject(Predicate<? super T> predicate)
- Specified by:
rejectin interfaceBag<T>- Specified by:
rejectin interfaceMutableBag<T>- Specified by:
rejectin interfaceMutableBagIterable<T>- Specified by:
rejectin interfaceMutableCollection<T>- Specified by:
rejectin interfaceRichIterable<T>- Specified by:
rejectin interfaceUnsortedBag<T>
-
rejectWith
public <P> MutableBag<T> rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
rejectWithin interfaceBag<T>- Specified by:
rejectWithin interfaceMutableBag<T>- Specified by:
rejectWithin interfaceMutableBagIterable<T>- Specified by:
rejectWithin interfaceMutableCollection<T>- Specified by:
rejectWithin interfaceRichIterable<T>- Specified by:
rejectWithin interfaceUnsortedBag<T>
-
partition
public PartitionMutableBag<T> partition(Predicate<? super T> predicate)
- Specified by:
partitionin interfaceBag<T>- Specified by:
partitionin interfaceMutableBag<T>- Specified by:
partitionin interfaceMutableBagIterable<T>- Specified by:
partitionin interfaceMutableCollection<T>- Specified by:
partitionin interfaceRichIterable<T>- Specified by:
partitionin interfaceUnsortedBag<T>
-
partitionWith
public <P> PartitionMutableBag<T> partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
partitionWithin interfaceBag<T>- Specified by:
partitionWithin interfaceMutableBag<T>- Specified by:
partitionWithin interfaceMutableBagIterable<T>- Specified by:
partitionWithin interfaceMutableCollection<T>- Specified by:
partitionWithin interfaceRichIterable<T>
-
countBy
public <V> MutableBag<V> countBy(Function<? super T,? extends V> function)
- Specified by:
countByin interfaceMutableBag<T>- Specified by:
countByin interfaceMutableCollection<T>- Specified by:
countByin interfaceRichIterable<T>- Overrides:
countByin classAbstractMutableBagIterable<T>- Since:
- 9.0
-
countByWith
public <V,P> MutableBag<V> countByWith(Function2<? super T,? super P,? extends V> function, P parameter)
- Specified by:
countByWithin interfaceMutableBag<T>- Specified by:
countByWithin interfaceMutableCollection<T>- Specified by:
countByWithin interfaceRichIterable<T>- Overrides:
countByWithin classAbstractMutableBagIterable<T>- Since:
- 9.0
-
countByEach
public <V> MutableBag<V> countByEach(Function<? super T,? extends Iterable<V>> function)
- Specified by:
countByEachin interfaceMutableBag<T>- Specified by:
countByEachin interfaceMutableCollection<T>- Specified by:
countByEachin interfaceRichIterable<T>- Overrides:
countByEachin classAbstractMutableBagIterable<T>- Since:
- 10.0.0
-
collectWithOccurrences
public <V> MutableBag<V> collectWithOccurrences(ObjectIntToObjectFunction<? super T,? extends V> function)
- Specified by:
collectWithOccurrencesin interfaceBag<T>- Specified by:
collectWithOccurrencesin interfaceMutableBag<T>- Specified by:
collectWithOccurrencesin interfaceMutableBagIterable<T>- Specified by:
collectWithOccurrencesin interfaceUnsortedBag<T>
-
collect
public <V> MutableBag<V> collect(Function<? super T,? extends V> function)
- Specified by:
collectin interfaceMutableBag<T>- Specified by:
collectin interfaceMutableCollection<T>- Specified by:
collectin interfaceRichIterable<T>- Specified by:
collectin interfaceUnsortedBag<T>
-
collectWith
public <P,V> MutableBag<V> collectWith(Function2<? super T,? super P,? extends V> function, P parameter)
- Specified by:
collectWithin interfaceMutableBag<T>- Specified by:
collectWithin interfaceMutableCollection<T>- Specified by:
collectWithin interfaceRichIterable<T>- Specified by:
collectWithin interfaceUnsortedBag<T>
-
collectIf
public <V> MutableBag<V> collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
- Specified by:
collectIfin interfaceMutableBag<T>- Specified by:
collectIfin interfaceMutableCollection<T>- Specified by:
collectIfin interfaceRichIterable<T>- Specified by:
collectIfin interfaceUnsortedBag<T>
-
flatCollect
public <V> MutableBag<V> flatCollect(Function<? super T,? extends Iterable<V>> function)
- Specified by:
flatCollectin interfaceMutableBag<T>- Specified by:
flatCollectin interfaceMutableCollection<T>- Specified by:
flatCollectin interfaceRichIterable<T>- Specified by:
flatCollectin interfaceUnsortedBag<T>
-
zip
@Deprecated public <S> MutableBag<Pair<T,S>> zip(Iterable<S> that)
Deprecated.in 6.0. UseOrderedIterable.zip(Iterable)instead.- Specified by:
zipin interfaceMutableBag<T>- Specified by:
zipin interfaceMutableCollection<T>- Specified by:
zipin interfaceRichIterable<T>- Specified by:
zipin interfaceUnsortedBag<T>
-
zipWithIndex
@Deprecated public MutableSet<Pair<T,Integer>> zipWithIndex()
Deprecated.in 6.0. UseOrderedIterable.zipWithIndex()instead.- Specified by:
zipWithIndexin interfaceBag<T>- Specified by:
zipWithIndexin interfaceMutableBag<T>- Specified by:
zipWithIndexin interfaceMutableBagIterable<T>- Specified by:
zipWithIndexin interfaceMutableCollection<T>- Specified by:
zipWithIndexin interfaceRichIterable<T>- Specified by:
zipWithIndexin interfaceUnsortedBag<T>
-
asParallel
public ParallelUnsortedBag<T> asParallel(ExecutorService executorService, int batchSize)
-
-