Class AbstractHashBag<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>
-
- org.eclipse.collections.impl.bag.mutable.AbstractHashBag<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:
HashBag,HashBagWithHashingStrategy
public abstract class AbstractHashBag<T> extends AbstractMutableBag<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractHashBag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T item)intaddOccurrences(T item, int occurrences)booleanallSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)booleananySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)voidclear()booleancontains(Object o)TdetectWithOccurrences(ObjectIntPredicate<? super T> predicate)RichIterable<T>distinctView()voideach(Procedure<? super T> procedure)booleanequals(Object other)<P> voidforEachWith(Procedure2<? super T,? super P> procedure, P parameter)voidforEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)voidforEachWithOccurrences(ObjectIntProcedure<? super T> objectIntProcedure)<V> HashBagMultimap<V,T>groupBy(Function<? super T,? extends V> function)<V> HashBagMultimap<V,T>groupByEach(Function<? super T,? extends Iterable<V>> function)inthashCode()booleanisEmpty()Iterator<T>iterator()booleannoneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)intoccurrencesOf(Object item)booleanremove(Object item)booleanremoveAllIterable(Iterable<?> iterable)booleanremoveIf(Predicate<? super T> predicate)<P> booleanremoveIfWith(Predicate2<? super T,? super P> predicate, P parameter)booleanremoveOccurrences(Object item, int occurrences)booleansetOccurrences(T item, int occurrences)intsize()intsizeDistinct()MutableMap<T,Integer>toMapOfItemToCount()-
Methods inherited from class org.eclipse.collections.impl.bag.mutable.AbstractMutableBag
asParallel, asSynchronized, asUnmodifiable, collect, collectIf, collectWith, collectWithOccurrences, countBy, countByEach, countByWith, flatCollect, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, tap, toImmutable, zip, zipWithIndex
-
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, containsAll, containsAllArguments, containsAllIterable, countWith, forEach, groupByUniqueKey, into, toArray, toArray, toBiMap, toMap, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSetBy, toString, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.bag.Bag
aggregateBy, collectWithOccurrences, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toStringOfItemToCount
-
Methods inherited from interface java.util.Collection
addAll, containsAll, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach
-
Methods inherited from interface org.eclipse.collections.api.bag.MutableBag
collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, flatCollectWith, newEmpty, selectByOccurrences, selectDuplicates, selectUnique, toImmutableBag, with, withAll, without, withoutAll
-
Methods inherited from interface org.eclipse.collections.api.bag.MutableBagIterable
bottomOccurrences, selectByOccurrences, selectDuplicates, selectUnique, 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, 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, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, 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, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reject, rejectWith, select, selectWith, 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
-
addOccurrences
public int addOccurrences(T item, int occurrences)
-
equals
public boolean equals(Object other)
-
hashCode
public int hashCode()
-
sizeDistinct
public int sizeDistinct()
-
occurrencesOf
public int occurrencesOf(Object item)
-
forEachWithOccurrences
public void forEachWithOccurrences(ObjectIntProcedure<? super T> objectIntProcedure)
-
anySatisfyWithOccurrences
public boolean anySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
-
allSatisfyWithOccurrences
public boolean allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
-
noneSatisfyWithOccurrences
public boolean noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
-
detectWithOccurrences
public T detectWithOccurrences(ObjectIntPredicate<? super T> predicate)
-
toMapOfItemToCount
public MutableMap<T,Integer> toMapOfItemToCount()
-
add
public boolean add(T item)
-
remove
public boolean remove(Object item)
-
clear
public void clear()
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<T>- Specified by:
isEmptyin interfaceRichIterable<T>- Overrides:
isEmptyin classAbstractRichIterable<T>
-
forEachWithIndex
public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
- Specified by:
forEachWithIndexin interfaceInternalIterable<T>- Overrides:
forEachWithIndexin classAbstractRichIterable<T>
-
forEachWith
public <P> void forEachWith(Procedure2<? super T,? super P> procedure, P parameter)
- Specified by:
forEachWithin interfaceInternalIterable<T>- Overrides:
forEachWithin classAbstractRichIterable<T>
-
removeOccurrences
public boolean removeOccurrences(Object item, int occurrences)
-
setOccurrences
public boolean setOccurrences(T item, int occurrences)
-
removeIfWith
public <P> boolean removeIfWith(Predicate2<? super T,? super P> predicate, P parameter)
-
removeAllIterable
public boolean removeAllIterable(Iterable<?> iterable)
-
size
public int size()
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<T>- Specified by:
containsin interfaceRichIterable<T>- Overrides:
containsin classAbstractRichIterable<T>
-
groupBy
public <V> HashBagMultimap<V,T> groupBy(Function<? super T,? extends V> function)
-
groupByEach
public <V> HashBagMultimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
-
distinctView
public RichIterable<T> distinctView()
-
-