@NotThreadSafe public final class FloatHashBag extends Object implements MutableFloatBag, Externalizable
HashBag, and is memory-optimized for float primitives.
This file was automatically generated from template file primitiveHashBag.stg.| Constructor and Description |
|---|
FloatHashBag() |
FloatHashBag(FloatHashBag bag) |
FloatHashBag(FloatIterable iterable) |
FloatHashBag(int size) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(float item) |
boolean |
addAll(float... source) |
boolean |
addAll(FloatIterable source) |
void |
addOccurrences(float item,
int occurrences) |
boolean |
allSatisfy(FloatPredicate predicate) |
boolean |
anySatisfy(FloatPredicate predicate) |
void |
appendString(Appendable appendable)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String separator)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable. |
LazyFloatIterable |
asLazy() |
MutableFloatBag |
asSynchronized() |
MutableFloatBag |
asUnmodifiable() |
double |
average() |
void |
clear() |
<V> MutableBag<V> |
collect(FloatToObjectFunction<? extends V> function) |
boolean |
contains(float value) |
boolean |
containsAll(float... source) |
boolean |
containsAll(FloatIterable source) |
int |
count(FloatPredicate predicate) |
float |
detectIfNone(FloatPredicate predicate,
float ifNone) |
boolean |
equals(Object otherBag)
Follows the same general contract as
Bag.equals(Object). |
FloatIterator |
floatIterator() |
void |
forEach(FloatProcedure procedure) |
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.
|
String |
makeString()
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
String |
makeString(String separator)
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
String |
makeString(String start,
String separator,
String end)
Returns a string representation of this collection.
|
float |
max() |
float |
maxIfEmpty(float defaultValue) |
double |
median() |
float |
min() |
float |
minIfEmpty(float defaultValue) |
static FloatHashBag |
newBag(FloatBag source) |
static FloatHashBag |
newBag(FloatIterable source) |
static FloatHashBag |
newBag(int size) |
static FloatHashBag |
newBagWith(float... source) |
boolean |
noneSatisfy(FloatPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
int |
occurrencesOf(float item)
The occurrences of a distinct item in the bag.
|
void |
readExternal(ObjectInput in) |
FloatHashBag |
reject(FloatPredicate predicate) |
boolean |
remove(float item) |
boolean |
removeAll(float... source) |
boolean |
removeAll(FloatIterable source) |
boolean |
removeOccurrences(float item,
int occurrences) |
boolean |
retainAll(float... source) |
boolean |
retainAll(FloatIterable source) |
FloatHashBag |
select(FloatPredicate predicate) |
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() |
MutableFloatBag |
toBag() |
ImmutableFloatBag |
toImmutable()
Returns an immutable copy of this bag.
|
MutableFloatList |
toList() |
MutableFloatSet |
toSet() |
float[] |
toSortedArray() |
MutableFloatList |
toSortedList() |
String |
toString()
Returns a string representation of this PrimitiveIterable.
|
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(ObjectOutput out) |
public FloatHashBag()
public FloatHashBag(int size)
public FloatHashBag(FloatIterable iterable)
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)
contains in interface FloatIterablepublic boolean containsAll(float... source)
containsAll in interface FloatIterablepublic boolean containsAll(FloatIterable source)
containsAll in interface FloatIterablepublic int occurrencesOf(float item)
FloatBagoccurrencesOf in interface FloatBagpublic void forEachWithOccurrences(FloatIntProcedure procedure)
FloatBagforEachWithOccurrences in interface FloatBagpublic boolean add(float item)
add in interface MutableFloatCollectionpublic boolean remove(float item)
remove 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)
forEach in interface FloatIterablepublic FloatHashBag select(FloatPredicate predicate)
select in interface FloatBagselect in interface MutableFloatBagselect in interface MutableFloatCollectionselect in interface FloatIterablepublic FloatHashBag reject(FloatPredicate predicate)
reject in interface FloatBagreject in interface MutableFloatBagreject in interface MutableFloatCollectionreject in interface FloatIterablepublic <T> T injectInto(T injectedValue,
ObjectFloatToObjectFunction<? super T,? extends T> function)
injectInto in interface FloatIterablepublic boolean equals(Object otherBag)
FloatBagBag.equals(Object).public int hashCode()
FloatBagBag.hashCode().public String toString()
PrimitiveIterabletoString in interface PrimitiveIterabletoString in class Objectpublic String makeString()
PrimitiveIterablePrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).makeString in interface PrimitiveIterablepublic String makeString(String separator)
PrimitiveIterablePrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString in interface PrimitiveIterablepublic String makeString(String start, String separator, String end)
PrimitiveIterablemakeString in interface PrimitiveIterablepublic void appendString(Appendable appendable)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString().appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String).appendString in interface PrimitiveIterablepublic 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(FloatPredicate predicate)
count in interface FloatIterablepublic boolean anySatisfy(FloatPredicate predicate)
anySatisfy in interface FloatIterablepublic boolean allSatisfy(FloatPredicate predicate)
allSatisfy in interface FloatIterablepublic boolean noneSatisfy(FloatPredicate predicate)
noneSatisfy in interface FloatIterablepublic float detectIfNone(FloatPredicate predicate, float ifNone)
detectIfNone in interface FloatIterablepublic <V> MutableBag<V> collect(FloatToObjectFunction<? extends V> function)
collect in interface FloatBagcollect in interface MutableFloatBagcollect in interface MutableFloatCollectioncollect in interface FloatIterablepublic float max()
max in interface FloatIterablepublic float min()
min in interface FloatIterablepublic double sum()
sum in interface FloatIterablepublic float minIfEmpty(float defaultValue)
minIfEmpty in interface FloatIterablepublic float maxIfEmpty(float defaultValue)
maxIfEmpty in interface FloatIterablepublic double average()
average in interface FloatIterablepublic double median()
median in interface FloatIterablepublic float[] toArray()
toArray in interface FloatIterablepublic float[] toSortedArray()
toSortedArray in interface FloatIterablepublic MutableFloatList toList()
toList in interface FloatIterablepublic MutableFloatList toSortedList()
toSortedList in interface FloatIterablepublic MutableFloatSet toSet()
toSet in interface FloatIterablepublic MutableFloatBag toBag()
toBag in interface FloatIterablepublic LazyFloatIterable asLazy()
asLazy 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 FloatIterator floatIterator()
floatIterator in interface FloatIterablepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionCopyright © 2004–2017. All rights reserved.