@NotThreadSafe public final class IntHashBag extends AbstractIntIterable implements MutableIntBag, Externalizable
HashBag, and is memory-optimized for int primitives.
This file was automatically generated from template file primitiveHashBag.stg.| Constructor and Description |
|---|
IntHashBag() |
IntHashBag(int... elements) |
IntHashBag(int size) |
IntHashBag(IntHashBag bag) |
IntHashBag(IntIterable iterable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int item) |
boolean |
addAll(int... source) |
boolean |
addAll(IntIterable source) |
void |
addOccurrences(int item,
int occurrences) |
boolean |
allSatisfy(IntPredicate predicate) |
boolean |
anySatisfy(IntPredicate predicate) |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable. |
MutableIntBag |
asSynchronized() |
MutableIntBag |
asUnmodifiable() |
void |
clear() |
<V> MutableBag<V> |
collect(IntToObjectFunction<? extends V> function) |
boolean |
contains(int value) |
int |
count(IntPredicate predicate) |
int |
detectIfNone(IntPredicate predicate,
int ifNone) |
void |
each(IntProcedure procedure) |
boolean |
equals(Object otherBag)
Follows the same general contract as
Bag.equals(Object). |
void |
forEach(IntProcedure procedure) |
void |
forEachWithOccurrences(IntIntProcedure procedure)
For each distinct item, with the number of occurrences, execute the specified procedure.
|
int |
hashCode()
Follows the same general contract as
Bag.hashCode(). |
<T> T |
injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function) |
MutableIntIterator |
intIterator() |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
int |
max() |
int |
min() |
static IntHashBag |
newBag(int size) |
static IntHashBag |
newBag(IntBag source) |
static IntHashBag |
newBag(IntIterable source) |
static IntHashBag |
newBagWith(int... source) |
boolean |
noneSatisfy(IntPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
int |
occurrencesOf(int item)
The occurrences of a distinct item in the bag.
|
void |
readExternal(ObjectInput in) |
IntHashBag |
reject(IntPredicate predicate) |
boolean |
remove(int item) |
boolean |
removeAll(int... source) |
boolean |
removeAll(IntIterable source) |
boolean |
removeOccurrences(int item,
int occurrences) |
boolean |
retainAll(int... source) |
boolean |
retainAll(IntIterable source) |
IntHashBag |
select(IntPredicate predicate) |
int |
size()
Returns the number of items in this iterable.
|
int |
sizeDistinct()
The size of the Bag when counting only distinct elements.
|
long |
sum() |
int[] |
toArray() |
ImmutableIntBag |
toImmutable()
Returns an immutable copy of this bag.
|
IntHashBag |
with(int element) |
IntHashBag |
with(int element1,
int element2) |
IntHashBag |
with(int element1,
int element2,
int element3) |
IntHashBag |
withAll(IntIterable iterable) |
IntHashBag |
without(int element) |
IntHashBag |
withoutAll(IntIterable iterable) |
void |
writeExternal(ObjectOutput out) |
appendString, appendString, asLazy, average, containsAll, containsAll, makeString, makeString, makeString, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringasLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedListappendString, appendString, makeString, makeString, makeString, toStringpublic IntHashBag()
public IntHashBag(int size)
public IntHashBag(IntIterable iterable)
public IntHashBag(int... elements)
public IntHashBag(IntHashBag bag)
public static IntHashBag newBag(int size)
public static IntHashBag newBagWith(int... source)
public static IntHashBag newBag(IntIterable source)
public static IntHashBag newBag(IntBag source)
public boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterableisEmpty in class AbstractIntIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablenotEmpty in class AbstractIntIterablepublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic int sizeDistinct()
IntBagsizeDistinct in interface IntBagpublic void clear()
clear in interface MutableIntCollectionpublic IntHashBag with(int element)
with in interface MutableIntBagwith in interface MutableIntCollectionpublic IntHashBag with(int element1, int element2)
public IntHashBag with(int element1, int element2, int element3)
public IntHashBag withAll(IntIterable iterable)
withAll in interface MutableIntBagwithAll in interface MutableIntCollectionpublic IntHashBag without(int element)
without in interface MutableIntBagwithout in interface MutableIntCollectionpublic IntHashBag withoutAll(IntIterable iterable)
withoutAll in interface MutableIntBagwithoutAll in interface MutableIntCollectionpublic boolean contains(int value)
contains in interface IntIterablepublic int occurrencesOf(int item)
IntBagoccurrencesOf in interface IntBagpublic void forEachWithOccurrences(IntIntProcedure procedure)
IntBagforEachWithOccurrences in interface IntBagpublic boolean add(int item)
add in interface MutableIntCollectionpublic boolean remove(int item)
remove in interface MutableIntCollectionpublic boolean addAll(int... source)
addAll in interface MutableIntCollectionpublic boolean addAll(IntIterable source)
addAll in interface MutableIntCollectionpublic boolean removeAll(int... source)
removeAll in interface MutableIntCollectionpublic boolean removeAll(IntIterable source)
removeAll in interface MutableIntCollectionpublic boolean retainAll(IntIterable source)
retainAll in interface MutableIntCollectionCollection.retainAll(Collection)public boolean retainAll(int... source)
retainAll in interface MutableIntCollectionCollection.retainAll(Collection)public void addOccurrences(int item,
int occurrences)
addOccurrences in interface MutableIntBagpublic boolean removeOccurrences(int item,
int occurrences)
removeOccurrences in interface MutableIntBagpublic void forEach(IntProcedure procedure)
forEach in interface IntIterablepublic void each(IntProcedure procedure)
each in interface IntIterablepublic IntHashBag select(IntPredicate predicate)
select in interface IntBagselect in interface MutableIntBagselect in interface MutableIntCollectionselect in interface IntIterablepublic IntHashBag reject(IntPredicate predicate)
reject in interface IntBagreject in interface MutableIntBagreject in interface MutableIntCollectionreject in interface IntIterablepublic <T> T injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function)
injectInto in interface IntIterablepublic boolean equals(Object otherBag)
IntBagBag.equals(Object).public int hashCode()
IntBagBag.hashCode().public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic int count(IntPredicate predicate)
count in interface IntIterablepublic boolean anySatisfy(IntPredicate predicate)
anySatisfy in interface IntIterablepublic boolean allSatisfy(IntPredicate predicate)
allSatisfy in interface IntIterablepublic boolean noneSatisfy(IntPredicate predicate)
noneSatisfy in interface IntIterablepublic int detectIfNone(IntPredicate predicate, int ifNone)
detectIfNone in interface IntIterablepublic <V> MutableBag<V> collect(IntToObjectFunction<? extends V> function)
collect in interface IntBagcollect in interface MutableIntBagcollect in interface MutableIntCollectioncollect in interface IntIterablepublic int max()
max in interface IntIterablepublic int min()
min in interface IntIterablepublic long sum()
sum in interface IntIterablepublic int[] toArray()
toArray in interface IntIterablepublic MutableIntBag asUnmodifiable()
asUnmodifiable in interface MutableIntBagasUnmodifiable in interface MutableIntCollectionpublic MutableIntBag asSynchronized()
asSynchronized in interface MutableIntBagasSynchronized in interface MutableIntCollectionpublic ImmutableIntBag toImmutable()
MutableIntBagtoImmutable in interface IntBagtoImmutable in interface MutableIntBagtoImmutable in interface MutableIntCollectionpublic MutableIntIterator intIterator()
intIterator in interface MutableIntCollectionintIterator in interface IntIterablepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionCopyright © 2004–2016. All rights reserved.