@NotThreadSafe public final class FloatHashBag extends AbstractFloatIterable 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(float... elements) |
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,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable . |
MutableFloatBag |
asSynchronized() |
MutableFloatBag |
asUnmodifiable() |
void |
clear() |
<V> MutableBag<V> |
collect(FloatToObjectFunction<? extends V> function) |
boolean |
contains(float value) |
int |
count(FloatPredicate predicate) |
float |
detectIfNone(FloatPredicate predicate,
float ifNone) |
void |
each(FloatProcedure procedure) |
boolean |
equals(Object otherBag)
Follows the same general contract as
Bag.equals(Object) . |
MutableFloatIterator |
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.
|
float |
max() |
float |
min() |
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() |
ImmutableFloatBag |
toImmutable()
Returns an immutable copy of this bag.
|
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) |
appendString, appendString, asLazy, average, containsAll, containsAll, makeString, makeString, makeString, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList
appendString, appendString, makeString, makeString, makeString, toString
public 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()
PrimitiveIterable
isEmpty
in interface PrimitiveIterable
isEmpty
in class AbstractFloatIterable
public boolean notEmpty()
PrimitiveIterable
notEmpty
in interface PrimitiveIterable
notEmpty
in class AbstractFloatIterable
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 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 void each(FloatProcedure procedure)
each
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 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[] toArray()
toArray
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 MutableFloatIterator floatIterator()
floatIterator
in interface MutableFloatCollection
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–2016. All rights reserved.