java.io.Externalizable, java.io.Serializable, IntBag, MutableIntBag, MutableIntCollection, IntIterable, PrimitiveIterablepublic class IntHashBag extends AbstractIntIterable implements MutableIntBag, java.io.Externalizable
HashBag, and is memory-optimized for int primitives.
 This file was automatically generated from template file primitiveHashBag.stg.| Constructor | Description | 
|---|---|
| IntHashBag() | |
| IntHashBag(int size) | |
| IntHashBag(int... elements) | |
| IntHashBag(IntIterable iterable) | |
| IntHashBag(IntHashBag bag) | 
| Modifier and Type | Method | Description | 
|---|---|---|
| boolean | add(int item) | |
| boolean | addAll(int... source) | |
| boolean | addAll(IntIterable source) | |
| void | addOccurrences(int item,
              int occurrences) | |
| boolean | allSatisfy(IntPredicate predicate) | Returns true if all of the elements in the IntIterable return true for the
 specified predicate, otherwise returns false. | 
| boolean | anySatisfy(IntPredicate predicate) | Returns true if any of the elements in the IntIterable return true for the
 specified predicate, otherwise returns false. | 
| void | appendString(java.lang.Appendable appendable,
            java.lang.String start,
            java.lang.String separator,
            java.lang.String end) | Prints a string representation of this collection onto the given  Appendable. | 
| MutableIntBag | asSynchronized() | |
| MutableIntBag | asUnmodifiable() | |
| MutableList<IntIntPair> | bottomOccurrences(int count) | Returns the  countleast frequently occurring items. | 
| RichIterable<IntIterable> | chunk(int size) | Partitions elements in fixed size chunks. | 
| void | clear() | |
| <V> MutableBag<V> | collect(IntToObjectFunction<? extends V> function) | Returns a new collection with the results of applying the specified function on each element of the source
 collection. | 
| boolean | contains(int value) | Returns true if the value is contained in the IntIterable, and false if it is not. | 
| int | count(IntPredicate predicate) | Returns a count of the number of elements in the IntIterable that return true for the
 specified predicate. | 
| int | detectIfNone(IntPredicate predicate,
            int ifNone) | |
| void | each(IntProcedure procedure) | A synonym for forEach. | 
| boolean | equals(java.lang.Object otherBag) | Follows the same general contract as  Bag.equals(Object). | 
| void | forEach(IntProcedure procedure) | Applies the IntProcedure to each element in the IntIterable. | 
| 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() | Returns a primitive iterator that can be used to iterate over the IntIterable in an
 imperative style. | 
| 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) | |
| IntHashBag | newEmpty() | Creates a new empty IntHashBag. | 
| boolean | noneSatisfy(IntPredicate predicate) | Returns true if none of the elements in the IntIterable return true for the
 specified predicate, otherwise returns false. | 
| boolean | notEmpty() | The English equivalent of !this.isEmpty() | 
| int | occurrencesOf(int item) | The occurrences of a distinct item in the bag. | 
| void | readExternal(java.io.ObjectInput in) | |
| IntHashBag | reject(IntPredicate predicate) | Returns a new IntIterable with all of the elements in the IntIterable that
 return false for the specified predicate. | 
| boolean | remove(int item) | |
| boolean | removeAll(int... source) | |
| boolean | removeAll(IntIterable source) | |
| boolean | removeIf(IntPredicate predicate) | |
| boolean | removeOccurrences(int item,
                 int occurrences) | |
| boolean | retainAll(int... source) | |
| boolean | retainAll(IntIterable source) | |
| IntHashBag | select(IntPredicate predicate) | Returns a new IntIterable with all of the elements in the IntIterable that
 return true for the specified predicate. | 
| IntHashBag | selectByOccurrences(IntPredicate predicate) | Returns all elements of the bag that have a number of occurrences that satisfy the predicate. | 
| MutableIntSet | selectUnique() | Returns all elements of the bag that have exactly one occurrence. | 
| 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() | Converts the IntIterable to a primitive int array. | 
| ImmutableIntBag | toImmutable() | Returns an immutable copy of this bag. | 
| MutableList<IntIntPair> | topOccurrences(int count) | Returns the  countmost frequently occurring items. | 
| 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(java.io.ObjectOutput out) | 
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringtoStringOfItemToCountasLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reject, select, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedListselectDuplicates, tapappendString, 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 PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic 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)
IntIterablecontains in interface IntIterablepublic int occurrencesOf(int item)
IntBagoccurrencesOf in interface IntBagpublic void forEachWithOccurrences(IntIntProcedure procedure)
IntBagforEachWithOccurrences in interface IntBagpublic IntHashBag selectByOccurrences(IntPredicate predicate)
MutableIntBagselectByOccurrences in interface IntBagselectByOccurrences in interface MutableIntBagpublic MutableIntSet selectUnique()
MutableIntBagselectUnique in interface IntBagselectUnique in interface MutableIntBagpublic MutableList<IntIntPair> topOccurrences(int count)
MutableIntBagcount most frequently occurring items.
 In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last
 item will be returned.topOccurrences in interface IntBagtopOccurrences in interface MutableIntBagpublic MutableList<IntIntPair> bottomOccurrences(int count)
MutableIntBagcount least frequently occurring items.
 In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last
 item will be returned.bottomOccurrences in interface IntBagbottomOccurrences in interface MutableIntBagpublic boolean add(int item)
add in interface MutableIntCollectionpublic boolean remove(int item)
remove in interface MutableIntCollectionpublic boolean removeIf(IntPredicate predicate)
removeIf 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)
IntIterableforEach in interface IntIterablepublic void each(IntProcedure procedure)
IntIterableeach in interface IntIterablepublic IntHashBag select(IntPredicate predicate)
IntIterableselect in interface IntBagselect in interface IntIterableselect in interface MutableIntBagselect in interface MutableIntCollectionpublic IntHashBag reject(IntPredicate predicate)
IntIterablereject in interface IntBagreject in interface IntIterablereject in interface MutableIntBagreject in interface MutableIntCollectionpublic <T> T injectInto(T injectedValue,
                        ObjectIntToObjectFunction<? super T,? extends T> function)
injectInto in interface IntIterablepublic RichIterable<IntIterable> chunk(int size)
IntIterablechunk in interface IntIterablesize - the number of elements per chunkRichIterable containing IntIterables of size size, except the last will be
 truncated if the elements don't divide evenly.public boolean equals(java.lang.Object otherBag)
IntBagBag.equals(Object).public int hashCode()
IntBagBag.hashCode().public void appendString(java.lang.Appendable appendable,
                         java.lang.String start,
                         java.lang.String separator,
                         java.lang.String end)
PrimitiveIterableAppendable.  Prints the string returned
 by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic int count(IntPredicate predicate)
IntIterablecount in interface IntIterablepublic boolean anySatisfy(IntPredicate predicate)
IntIterableanySatisfy in interface IntIterablepublic boolean allSatisfy(IntPredicate predicate)
IntIterableallSatisfy in interface IntIterablepublic boolean noneSatisfy(IntPredicate predicate)
IntIterablenoneSatisfy in interface IntIterablepublic int detectIfNone(IntPredicate predicate, int ifNone)
detectIfNone in interface IntIterablepublic <V> MutableBag<V> collect(IntToObjectFunction<? extends V> function)
IntIterablecollect in interface IntBagcollect in interface IntIterablecollect in interface MutableIntBagcollect in interface MutableIntCollectionpublic int max()
max in interface IntIterablepublic int min()
min in interface IntIterablepublic long sum()
sum in interface IntIterablepublic int[] toArray()
IntIterabletoArray 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 IntHashBag newEmpty()
newEmpty in interface MutableIntBagnewEmpty in interface MutableIntCollectionpublic MutableIntIterator intIterator()
IntIterableintIterator in interface IntIterableintIterator in interface MutableIntCollectionpublic void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException
readExternal in interface java.io.Externalizablejava.io.IOExceptionCopyright © 2004–2018. All rights reserved.