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)voidtrimToSize()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, toArray, toArray, 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, toBiMap, toMap, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSetBy, toString, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.bag.Bag
aggregateBy, collectWithOccurrences, reduceBy, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toStringOfItemToCount
-
Methods inherited from interface java.util.Collection
addAll, containsAll, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, 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, withOccurrences, withoutOccurrences
-
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, toArray, toArray
-
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, reduceBy, 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:
selectByOccurrencesin interfaceBag<T>- Specified by:
selectByOccurrencesin interfaceMutableBag<T>- Specified by:
selectByOccurrencesin interfaceMutableBagIterable<T>- Specified by:
selectByOccurrencesin interfaceUnsortedBag<T>
-
with
public MutableBag<T> with(T element)
- Specified by:
within interfaceMutableBag<T>- Specified by:
within interfaceMutableBagIterable<T>- Specified by:
within interfaceMutableCollection<T>
-
without
public MutableBag<T> without(T element)
- Specified by:
withoutin interfaceMutableBag<T>- Specified by:
withoutin interfaceMutableBagIterable<T>- Specified by:
withoutin interfaceMutableCollection<T>
-
withAll
public MutableBag<T> withAll(Iterable<? extends T> elements)
- Specified by:
withAllin interfaceMutableBag<T>- Specified by:
withAllin interfaceMutableBagIterable<T>- Specified by:
withAllin interfaceMutableCollection<T>
-
withoutAll
public MutableBag<T> withoutAll(Iterable<? extends T> elements)
- Specified by:
withoutAllin interfaceMutableBag<T>- Specified by:
withoutAllin interfaceMutableBagIterable<T>- Specified by:
withoutAllin interfaceMutableCollection<T>
-
newEmpty
public MutableBag<T> newEmpty()
- Specified by:
newEmptyin interfaceMutableBag<T>- Specified by:
newEmptyin interfaceMutableCollection<T>
-
-