public class HashBagWithHashingStrategy<T> extends AbstractHashBag<T> implements Serializable
Constructor and Description |
---|
HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy) |
HashBagWithHashingStrategy(HashingStrategy<? super T> hashingStrategy,
int size) |
Modifier and Type | Method and Description |
---|---|
HashingStrategy<? super T> |
hashingStrategy() |
static <E> HashBagWithHashingStrategy<E> |
newBag(HashingStrategy<? super E> hashingStrategy) |
static <E> HashBagWithHashingStrategy<E> |
newBag(HashingStrategy<? super E> hashingStrategy,
Bag<? extends E> source) |
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> |
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(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(Iterable<? extends T> elements)
This method allows mutable and fixed size collections the ability to remove multiple elements from their existing
elements.
|
add, addAll, addOccurrences, clear, contains, each, equals, forEachWith, forEachWithIndex, forEachWithOccurrences, groupBy, groupByEach, hashCode, isEmpty, iterator, occurrencesOf, remove, removeAllIterable, removeIf, removeIfWith, removeOccurrences, setOccurrences, size, sizeDistinct, toMapOfItemToCount
asParallel, asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, flatCollect, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, tap, toImmutable, zip, zipWithIndex
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, topOccurrences
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, toStringOfItemToCount
appendString, appendString, asLazy, containsAll, containsAllArguments, containsAllIterable, countWith, forEach, groupByUniqueKey, into, toArray, toArray, toMap, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedSetBy, toString, zip, zipWithIndex
bottomOccurrences, topOccurrences
reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toStringOfItemToCount
addAllIterable, aggregateBy, aggregateInPlaceBy, groupByUniqueKey, injectIntoWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLong
containsAll, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, flatCollect, getFirst, getLast, getOnly, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
forEach
public 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, 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)
Bag
selectByOccurrences
in interface Bag<T>
selectByOccurrences
in interface MutableBag<T>
selectByOccurrences
in interface MutableBagIterable<T>
selectByOccurrences
in interface UnsortedBag<T>
selectByOccurrences
in class AbstractHashBag<T>
public MutableBag<T> with(T element)
MutableCollection
MutableCollectionIn the case oflist; list = list.with("1"); list = list.with("2"); return list;
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
MutableCollectionIn the case oflist; list = list.without("1"); list = list.without("2"); return list;
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(Iterable<? extends T> elements)
MutableCollection
MutableCollectionIn the case oflist; list = list.withAll(FastList.newListWith("1", "2")); return list;
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(Iterable<? extends T> elements)
MutableCollection
MutableCollectionIn the case oflist; list = list.withoutAll(FastList.newListWith("1", "2")); return list;
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()
MutableCollection
newEmpty
in interface MutableBag<T>
newEmpty
in interface MutableCollection<T>
Copyright © 2004–2016. All rights reserved.