java.io.Externalizable, java.io.Serializable, FloatBag, MutableFloatBag, MutableFloatCollection, FloatIterable, PrimitiveIterablepublic class FloatHashBag extends AbstractFloatIterable implements MutableFloatBag, java.io.Externalizable
HashBag, and is memory-optimized for float primitives.
This file was automatically generated from template file primitiveHashBag.stg.| Constructor | Description |
|---|---|
FloatHashBag() |
|
FloatHashBag(float... elements) |
|
FloatHashBag(int size) |
|
FloatHashBag(FloatIterable iterable) |
|
FloatHashBag(FloatHashBag bag) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(float item) |
|
boolean |
addAll(float... source) |
|
boolean |
addAll(FloatIterable source) |
|
void |
addOccurrences(float item,
int occurrences) |
|
boolean |
allSatisfy(FloatPredicate predicate) |
Returns true if all of the elements in the FloatIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(FloatPredicate predicate) |
Returns true if any of the elements in the FloatIterable 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. |
MutableFloatBag |
asSynchronized() |
|
MutableFloatBag |
asUnmodifiable() |
|
MutableList<FloatIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
RichIterable<FloatIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<V> MutableBag<V> |
collect(FloatToObjectFunction<? extends V> function) |
Returns a new collection with the results of applying the specified function on each element of the source
collection.
|
boolean |
contains(float value) |
Returns true if the value is contained in the FloatIterable, and false if it is not.
|
int |
count(FloatPredicate predicate) |
Returns a count of the number of elements in the FloatIterable that return true for the
specified predicate.
|
float |
detectIfNone(FloatPredicate predicate,
float ifNone) |
|
void |
each(FloatProcedure procedure) |
A synonym for forEach.
|
boolean |
equals(java.lang.Object otherBag) |
Follows the same general contract as
Bag.equals(Object). |
MutableFloatIterator |
floatIterator() |
Returns a primitive iterator that can be used to iterate over the FloatIterable in an
imperative style.
|
void |
forEach(FloatProcedure procedure) |
Applies the FloatProcedure to each element in the FloatIterable.
|
void |
forEachWithOccurrences(FloatIntProcedure 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,
ObjectFloatToObjectFunction<? super T,? extends T> function) |
|
boolean |
isEmpty() |
Returns true if this iterable has zero items.
|
float |
max() |
|
float |
min() |
|
static FloatHashBag |
newBag(int size) |
|
static FloatHashBag |
newBag(FloatBag source) |
|
static FloatHashBag |
newBag(FloatIterable source) |
|
static FloatHashBag |
newBagWith(float... source) |
|
FloatHashBag |
newEmpty() |
Creates a new empty FloatHashBag.
|
boolean |
noneSatisfy(FloatPredicate predicate) |
Returns true if none of the elements in the FloatIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
notEmpty() |
The English equivalent of !this.isEmpty()
|
int |
occurrencesOf(float item) |
The occurrences of a distinct item in the bag.
|
void |
readExternal(java.io.ObjectInput in) |
|
FloatHashBag |
reject(FloatPredicate predicate) |
Returns a new FloatIterable with all of the elements in the FloatIterable that
return false for the specified predicate.
|
boolean |
remove(float item) |
|
boolean |
removeAll(float... source) |
|
boolean |
removeAll(FloatIterable source) |
|
boolean |
removeIf(FloatPredicate predicate) |
|
boolean |
removeOccurrences(float item,
int occurrences) |
|
boolean |
retainAll(float... source) |
|
boolean |
retainAll(FloatIterable source) |
|
FloatHashBag |
select(FloatPredicate predicate) |
Returns a new FloatIterable with all of the elements in the FloatIterable that
return true for the specified predicate.
|
FloatHashBag |
selectByOccurrences(IntPredicate predicate) |
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
MutableFloatSet |
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.
|
double |
sum() |
|
float[] |
toArray() |
Converts the FloatIterable to a primitive float array.
|
ImmutableFloatBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<FloatIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
FloatHashBag |
with(float element) |
|
FloatHashBag |
with(float element1,
float element2) |
|
FloatHashBag |
with(float element1,
float element2,
float element3) |
|
FloatHashBag |
withAll(FloatIterable iterable) |
|
FloatHashBag |
without(float element) |
|
FloatHashBag |
withoutAll(FloatIterable 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 FloatHashBag()
public FloatHashBag(int size)
public FloatHashBag(FloatIterable iterable)
public FloatHashBag(float... elements)
public FloatHashBag(FloatHashBag bag)
public static FloatHashBag newBag(int size)
public static FloatHashBag newBagWith(float... source)
public static FloatHashBag newBag(FloatIterable source)
public static FloatHashBag newBag(FloatBag source)
public boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic int sizeDistinct()
FloatBagsizeDistinct in interface FloatBagpublic void clear()
clear in interface MutableFloatCollectionpublic FloatHashBag with(float element)
with in interface MutableFloatBagwith in interface MutableFloatCollectionpublic FloatHashBag with(float element1, float element2)
public FloatHashBag with(float element1, float element2, float element3)
public FloatHashBag withAll(FloatIterable iterable)
withAll in interface MutableFloatBagwithAll in interface MutableFloatCollectionpublic FloatHashBag without(float element)
without in interface MutableFloatBagwithout in interface MutableFloatCollectionpublic FloatHashBag withoutAll(FloatIterable iterable)
withoutAll in interface MutableFloatBagwithoutAll in interface MutableFloatCollectionpublic boolean contains(float value)
FloatIterablecontains in interface FloatIterablepublic int occurrencesOf(float item)
FloatBagoccurrencesOf in interface FloatBagpublic void forEachWithOccurrences(FloatIntProcedure procedure)
FloatBagforEachWithOccurrences in interface FloatBagpublic FloatHashBag selectByOccurrences(IntPredicate predicate)
MutableFloatBagselectByOccurrences in interface FloatBagselectByOccurrences in interface MutableFloatBagpublic MutableFloatSet selectUnique()
MutableFloatBagselectUnique in interface FloatBagselectUnique in interface MutableFloatBagpublic MutableList<FloatIntPair> topOccurrences(int count)
MutableFloatBagcount 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 FloatBagtopOccurrences in interface MutableFloatBagpublic MutableList<FloatIntPair> bottomOccurrences(int count)
MutableFloatBagcount 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 FloatBagbottomOccurrences in interface MutableFloatBagpublic boolean add(float item)
add in interface MutableFloatCollectionpublic boolean remove(float item)
remove in interface MutableFloatCollectionpublic boolean removeIf(FloatPredicate predicate)
removeIf in interface MutableFloatCollectionpublic boolean addAll(float... source)
addAll in interface MutableFloatCollectionpublic boolean addAll(FloatIterable source)
addAll in interface MutableFloatCollectionpublic boolean removeAll(float... source)
removeAll in interface MutableFloatCollectionpublic boolean removeAll(FloatIterable source)
removeAll in interface MutableFloatCollectionpublic boolean retainAll(FloatIterable source)
retainAll in interface MutableFloatCollectionCollection.retainAll(Collection)public boolean retainAll(float... source)
retainAll in interface MutableFloatCollectionCollection.retainAll(Collection)public void addOccurrences(float item,
int occurrences)
addOccurrences in interface MutableFloatBagpublic boolean removeOccurrences(float item,
int occurrences)
removeOccurrences in interface MutableFloatBagpublic void forEach(FloatProcedure procedure)
FloatIterableforEach in interface FloatIterablepublic void each(FloatProcedure procedure)
FloatIterableeach in interface FloatIterablepublic FloatHashBag select(FloatPredicate predicate)
FloatIterableselect in interface FloatBagselect in interface FloatIterableselect in interface MutableFloatBagselect in interface MutableFloatCollectionpublic FloatHashBag reject(FloatPredicate predicate)
FloatIterablereject in interface FloatBagreject in interface FloatIterablereject in interface MutableFloatBagreject in interface MutableFloatCollectionpublic <T> T injectInto(T injectedValue,
ObjectFloatToObjectFunction<? super T,? extends T> function)
injectInto in interface FloatIterablepublic RichIterable<FloatIterable> chunk(int size)
FloatIterablechunk in interface FloatIterablesize - the number of elements per chunkRichIterable containing FloatIterables of size size, except the last will be
truncated if the elements don't divide evenly.public boolean equals(java.lang.Object otherBag)
FloatBagBag.equals(Object).public int hashCode()
FloatBagBag.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(FloatPredicate predicate)
FloatIterablecount in interface FloatIterablepublic boolean anySatisfy(FloatPredicate predicate)
FloatIterableanySatisfy in interface FloatIterablepublic boolean allSatisfy(FloatPredicate predicate)
FloatIterableallSatisfy in interface FloatIterablepublic boolean noneSatisfy(FloatPredicate predicate)
FloatIterablenoneSatisfy in interface FloatIterablepublic float detectIfNone(FloatPredicate predicate, float ifNone)
detectIfNone in interface FloatIterablepublic <V> MutableBag<V> collect(FloatToObjectFunction<? extends V> function)
FloatIterablecollect in interface FloatBagcollect in interface FloatIterablecollect in interface MutableFloatBagcollect in interface MutableFloatCollectionpublic float max()
max in interface FloatIterablepublic float min()
min in interface FloatIterablepublic double sum()
sum in interface FloatIterablepublic float[] toArray()
FloatIterabletoArray in interface FloatIterablepublic MutableFloatBag asUnmodifiable()
asUnmodifiable in interface MutableFloatBagasUnmodifiable in interface MutableFloatCollectionpublic MutableFloatBag asSynchronized()
asSynchronized in interface MutableFloatBagasSynchronized in interface MutableFloatCollectionpublic ImmutableFloatBag toImmutable()
MutableFloatBagtoImmutable in interface FloatBagtoImmutable in interface MutableFloatBagtoImmutable in interface MutableFloatCollectionpublic FloatHashBag newEmpty()
newEmpty in interface MutableFloatBagnewEmpty in interface MutableFloatCollectionpublic MutableFloatIterator floatIterator()
FloatIterablefloatIterator in interface FloatIterablefloatIterator in interface MutableFloatCollectionpublic 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.