java.io.Serializable, java.lang.Iterable<T>, java.util.Collection<T>, Bag<T>, MutableBag<T>, MutableBagIterable<T>, UnsortedBag<T>, MutableCollection<T>, InternalIterable<T>, RichIterable<T>public class HashBagWithHashingStrategy<T> extends AbstractHashBag<T> implements java.io.Serializable
| Constructor | Description |
|---|---|
HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy) |
|
HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy,
int size) |
| 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,
java.lang.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() |
Creates a new empty mutable version of the same collection type.
|
MutableBag<T> |
selectByOccurrences(IntPredicate predicate) |
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
MutableBag<T> |
with(T element) |
This method allows mutable and fixed size collections the ability to add elements to their existing elements.
|
MutableBag<T> |
withAll(java.lang.Iterable<? extends T> elements) |
This method allows mutable and fixed size collections the ability to add multiple elements to their existing
elements.
|
MutableBag<T> |
without(T element) |
This method allows mutable and fixed size collections the ability to remove elements from their existing elements.
|
MutableBag<T> |
withoutAll(java.lang.Iterable<? extends T> elements) |
This method allows mutable and fixed size collections the ability to remove multiple elements from their existing
elements.
|
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, count, flatCollect, groupBy, groupByEach, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoWith, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toList, toSet, toSortedBag, toSortedBag, toSortedList, toSortedSet, toSortedSet, toStringOfItemToCountadd, addOccurrences, clear, contains, each, equals, forEachWith, forEachWithIndex, forEachWithOccurrences, groupBy, groupByEach, hashCode, isEmpty, iterator, occurrencesOf, remove, removeAllIterable, removeIf, removeIfWith, removeOccurrences, setOccurrences, size, sizeDistinct, toMapOfItemToCountasParallel, asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, collectWithOccurrences, countBy, countByEach, countByWith, flatCollect, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, tap, toImmutable, zip, zipWithIndexaddAll, addAllIterable, aggregateBy, aggregateInPlaceBy, 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, topOccurrencesappendString, appendString, asLazy, containsAll, containsAllArguments, containsAllIterable, countWith, forEach, groupByUniqueKey, into, toArray, toArray, toBiMap, toMap, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSetBy, toString, zip, zipWithIndexcollectWithOccurrences, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toStringOfItemToCountaddAll, containsAll, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayforEachflatCollectWith, selectDuplicates, selectUniquebottomOccurrences, topOccurrencesaddAllIterable, aggregateBy, aggregateInPlaceBy, groupByUniqueKey, injectIntoWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, containsAll, containsAllArguments, containsAllIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, flatCollect, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, 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, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexpublic HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy)
public HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy, int size)
public static <E> HashBagWithHashingStrategy<E> newBag(HashingStrategy<? super E> hashingStrategy)
public static <E> HashBagWithHashingStrategy<E> newBag(HashingStrategy<? super E> hashingStrategy, int size)
public static <E> HashBagWithHashingStrategy<E> newBag(HashingStrategy<? super E> hashingStrategy, Bag<? extends E> source)
public static <E> HashBagWithHashingStrategy<E> newBag(HashingStrategy<? super E> hashingStrategy, java.lang.Iterable<? extends E> source)
public static <E> HashBagWithHashingStrategy<E> newBagWith(HashingStrategy<? super E> hashingStrategy, E... elements)
public HashingStrategy<? super T> hashingStrategy()
public MutableBag<T> selectByOccurrences(IntPredicate predicate)
BagselectByOccurrences in interface Bag<T>selectByOccurrences in interface MutableBag<T>selectByOccurrences in interface MutableBagIterable<T>selectByOccurrences in interface UnsortedBag<T>public MutableBag<T> with(T element)
MutableCollection
MutableCollection<String> list = list.with("1");
list = list.with("2");
return list;
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by with, and any
variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling add on itself.with in interface MutableBag<T>with in interface MutableBagIterable<T>with in interface MutableCollection<T>Collection.add(Object)public MutableBag<T> without(T element)
MutableCollection
MutableCollection<String> list = list.without("1");
list = list.without("2");
return list;
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by without, and
any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling remove on itself.without in interface MutableBag<T>without in interface MutableBagIterable<T>without in interface MutableCollection<T>Collection.remove(Object)public MutableBag<T> withAll(java.lang.Iterable<? extends T> elements)
MutableCollection
MutableCollection<String> list = list.withAll(FastList.newListWith("1", "2"));
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withAll, and
any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling addAll on itself.withAll in interface MutableBag<T>withAll in interface MutableBagIterable<T>withAll in interface MutableCollection<T>Collection.addAll(Collection)public MutableBag<T> withoutAll(java.lang.Iterable<? extends T> elements)
MutableCollection
MutableCollection<String> list = list.withoutAll(FastList.newListWith("1", "2"));
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withoutAll,
and any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling removeAll on itself.withoutAll in interface MutableBag<T>withoutAll in interface MutableBagIterable<T>withoutAll in interface MutableCollection<T>Collection.removeAll(Collection)public MutableBag<T> newEmpty()
MutableCollectionnewEmpty in interface MutableBag<T>newEmpty in interface MutableCollection<T>Copyright © 2004–2020. All rights reserved.