Class HashBagWithHashingStrategy<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>
-
- org.eclipse.collections.impl.bag.strategy.mutable.HashBagWithHashingStrategy<T>
-
- All Implemented Interfaces:
Serializable
,Iterable<T>
,Collection<T>
,Bag<T>
,MutableBag<T>
,MutableBagIterable<T>
,UnsortedBag<T>
,MutableCollection<T>
,InternalIterable<T>
,RichIterable<T>
public class HashBagWithHashingStrategy<T> extends AbstractHashBag<T> implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy)
HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy, int size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HashingStrategy<? super T>
hashingStrategy()
static <E> HashBagWithHashingStrategy<E>
newBag(HashingStrategy<? super E> hashingStrategy)
static <E> HashBagWithHashingStrategy<E>
newBag(HashingStrategy<? super E> hashingStrategy, int size)
static <E> HashBagWithHashingStrategy<E>
newBag(HashingStrategy<? super E> hashingStrategy, Iterable<? extends E> source)
static <E> HashBagWithHashingStrategy<E>
newBag(HashingStrategy<? super E> hashingStrategy, Bag<? extends E> source)
static <E> HashBagWithHashingStrategy<E>
newBagWith(HashingStrategy<? super E> hashingStrategy, E... elements)
MutableBag<T>
newEmpty()
MutableBag<T>
selectByOccurrences(IntPredicate predicate)
void
trimToSize()
Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.MutableBag<T>
with(T element)
MutableBag<T>
withAll(Iterable<? extends T> elements)
MutableBag<T>
without(T element)
MutableBag<T>
withoutAll(Iterable<? extends T> elements)
-
Methods inherited from class org.eclipse.collections.impl.bag.mutable.AbstractHashBag
add, addOccurrences, allSatisfyWithOccurrences, anySatisfyWithOccurrences, clear, contains, detectWithOccurrences, distinctView, each, equals, forEachWith, forEachWithIndex, forEachWithOccurrences, groupBy, groupByEach, hashCode, isEmpty, iterator, noneSatisfyWithOccurrences, occurrencesOf, remove, removeAllIterable, removeIf, removeIfWith, removeOccurrences, setOccurrences, size, sizeDistinct, 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, selectDuplicates, selectUnique, toImmutableBag
-
Methods inherited from interface org.eclipse.collections.api.bag.MutableBagIterable
bottomOccurrences, 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
-
-
-
-
Constructor Detail
-
HashBagWithHashingStrategy
public HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy)
-
HashBagWithHashingStrategy
public HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy, int size)
-
-
Method Detail
-
newBag
public static <E> HashBagWithHashingStrategy<E> newBag(HashingStrategy<? super E> hashingStrategy)
-
newBag
public static <E> HashBagWithHashingStrategy<E> newBag(HashingStrategy<? super E> hashingStrategy, int size)
-
newBag
public static <E> HashBagWithHashingStrategy<E> newBag(HashingStrategy<? super E> hashingStrategy, Bag<? extends E> source)
-
newBag
public static <E> HashBagWithHashingStrategy<E> newBag(HashingStrategy<? super E> hashingStrategy, Iterable<? extends E> source)
-
newBagWith
public static <E> HashBagWithHashingStrategy<E> newBagWith(HashingStrategy<? super E> hashingStrategy, E... elements)
-
trimToSize
public void trimToSize()
Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.- Since:
- 12.0
-
hashingStrategy
public HashingStrategy<? super T> hashingStrategy()
-
selectByOccurrences
public MutableBag<T> selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrences
in interfaceBag<T>
- Specified by:
selectByOccurrences
in interfaceMutableBag<T>
- Specified by:
selectByOccurrences
in interfaceMutableBagIterable<T>
- Specified by:
selectByOccurrences
in interfaceUnsortedBag<T>
-
with
public MutableBag<T> with(T element)
- Specified by:
with
in interfaceMutableBag<T>
- Specified by:
with
in interfaceMutableBagIterable<T>
- Specified by:
with
in interfaceMutableCollection<T>
-
without
public MutableBag<T> without(T element)
- Specified by:
without
in interfaceMutableBag<T>
- Specified by:
without
in interfaceMutableBagIterable<T>
- Specified by:
without
in interfaceMutableCollection<T>
-
withAll
public MutableBag<T> withAll(Iterable<? extends T> elements)
- Specified by:
withAll
in interfaceMutableBag<T>
- Specified by:
withAll
in interfaceMutableBagIterable<T>
- Specified by:
withAll
in interfaceMutableCollection<T>
-
withoutAll
public MutableBag<T> withoutAll(Iterable<? extends T> elements)
- Specified by:
withoutAll
in interfaceMutableBag<T>
- Specified by:
withoutAll
in interfaceMutableBagIterable<T>
- Specified by:
withoutAll
in interfaceMutableCollection<T>
-
newEmpty
public MutableBag<T> newEmpty()
- Specified by:
newEmpty
in interfaceMutableBag<T>
- Specified by:
newEmpty
in interfaceMutableCollection<T>
-
-