@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()
PrimitiveIterable
isEmpty
in interface PrimitiveIterable
public boolean notEmpty()
PrimitiveIterable
notEmpty
in interface PrimitiveIterable
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
public int sizeDistinct()
FloatBag
sizeDistinct
in interface FloatBag
public void clear()
clear
in interface MutableFloatCollection
public FloatHashBag with(float element)
with
in interface MutableFloatBag
with
in interface MutableFloatCollection
public FloatHashBag with(float element1, float element2)
public FloatHashBag with(float element1, float element2, float element3)
public FloatHashBag withAll(FloatIterable iterable)
withAll
in interface MutableFloatBag
withAll
in interface MutableFloatCollection
public FloatHashBag without(float element)
without
in interface MutableFloatBag
without
in interface MutableFloatCollection
public FloatHashBag withoutAll(FloatIterable iterable)
withoutAll
in interface MutableFloatBag
withoutAll
in interface MutableFloatCollection
public boolean contains(float value)
contains
in interface FloatIterable
public boolean containsAll(float... source)
containsAll
in interface FloatIterable
public boolean containsAll(FloatIterable source)
containsAll
in interface FloatIterable
public int occurrencesOf(float item)
FloatBag
occurrencesOf
in interface FloatBag
public void forEachWithOccurrences(FloatIntProcedure procedure)
FloatBag
forEachWithOccurrences
in interface FloatBag
public boolean add(float item)
add
in interface MutableFloatCollection
public boolean remove(float item)
remove
in interface MutableFloatCollection
public boolean addAll(float... source)
addAll
in interface MutableFloatCollection
public boolean addAll(FloatIterable source)
addAll
in interface MutableFloatCollection
public boolean removeAll(float... source)
removeAll
in interface MutableFloatCollection
public boolean removeAll(FloatIterable source)
removeAll
in interface MutableFloatCollection
public boolean retainAll(FloatIterable source)
retainAll
in interface MutableFloatCollection
Collection.retainAll(Collection)
public boolean retainAll(float... source)
retainAll
in interface MutableFloatCollection
Collection.retainAll(Collection)
public void addOccurrences(float item, int occurrences)
addOccurrences
in interface MutableFloatBag
public boolean removeOccurrences(float item, int occurrences)
removeOccurrences
in interface MutableFloatBag
public void forEach(FloatProcedure procedure)
forEach
in interface FloatIterable
public FloatHashBag select(FloatPredicate predicate)
select
in interface FloatBag
select
in interface MutableFloatBag
select
in interface MutableFloatCollection
select
in interface FloatIterable
public FloatHashBag reject(FloatPredicate predicate)
reject
in interface FloatBag
reject
in interface MutableFloatBag
reject
in interface MutableFloatCollection
reject
in interface FloatIterable
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)
injectInto
in interface FloatIterable
public boolean equals(Object otherBag)
FloatBag
Bag.equals(Object)
.public int hashCode()
FloatBag
Bag.hashCode()
.public String toString()
PrimitiveIterable
toString
in interface PrimitiveIterable
toString
in class Object
public String makeString()
PrimitiveIterable
PrimitiveIterable.makeString(String)
and defaulting
the separator parameter to the characters ", " (comma and space).makeString
in interface PrimitiveIterable
public String makeString(String separator)
PrimitiveIterable
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString
in interface PrimitiveIterable
public String makeString(String start, String separator, String end)
PrimitiveIterable
makeString
in interface PrimitiveIterable
public void appendString(Appendable appendable)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString()
.appendString
in interface PrimitiveIterable
public void appendString(Appendable appendable, String separator)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String)
.appendString
in interface PrimitiveIterable
public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public int count(FloatPredicate predicate)
count
in interface FloatIterable
public boolean anySatisfy(FloatPredicate predicate)
anySatisfy
in interface FloatIterable
public boolean allSatisfy(FloatPredicate predicate)
allSatisfy
in interface FloatIterable
public boolean noneSatisfy(FloatPredicate predicate)
noneSatisfy
in interface FloatIterable
public float detectIfNone(FloatPredicate predicate, float ifNone)
detectIfNone
in interface FloatIterable
public <V> MutableBag<V> collect(FloatToObjectFunction<? extends V> function)
collect
in interface FloatBag
collect
in interface MutableFloatBag
collect
in interface MutableFloatCollection
collect
in interface FloatIterable
public float max()
max
in interface FloatIterable
public float min()
min
in interface FloatIterable
public double sum()
sum
in interface FloatIterable
public float minIfEmpty(float defaultValue)
minIfEmpty
in interface FloatIterable
public float maxIfEmpty(float defaultValue)
maxIfEmpty
in interface FloatIterable
public double average()
average
in interface FloatIterable
public double median()
median
in interface FloatIterable
public float[] toArray()
toArray
in interface FloatIterable
public float[] toSortedArray()
toSortedArray
in interface FloatIterable
public MutableFloatList toList()
toList
in interface FloatIterable
public MutableFloatList toSortedList()
toSortedList
in interface FloatIterable
public MutableFloatSet toSet()
toSet
in interface FloatIterable
public MutableFloatBag toBag()
toBag
in interface FloatIterable
public LazyFloatIterable asLazy()
asLazy
in interface FloatIterable
public MutableFloatBag asUnmodifiable()
asUnmodifiable
in interface MutableFloatBag
asUnmodifiable
in interface MutableFloatCollection
public MutableFloatBag asSynchronized()
asSynchronized
in interface MutableFloatBag
asSynchronized
in interface MutableFloatCollection
public ImmutableFloatBag toImmutable()
MutableFloatBag
toImmutable
in interface FloatBag
toImmutable
in interface MutableFloatBag
toImmutable
in interface MutableFloatCollection
public FloatIterator floatIterator()
floatIterator
in interface FloatIterable
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
Copyright © 2004–2017. All rights reserved.