java.io.Externalizable
, java.io.Serializable
, FloatBag
, MutableFloatBag
, MutableFloatCollection
, FloatIterable
, PrimitiveIterable
public final 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. |
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) |
|
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 |
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.
|
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, toString
asLazy, 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, toSortedList
tap
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
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)
FloatIterable
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 FloatHashBag selectByOccurrences(IntPredicate predicate)
MutableFloatBag
selectByOccurrences
in interface FloatBag
selectByOccurrences
in interface MutableFloatBag
public MutableList<FloatIntPair> topOccurrences(int count)
MutableFloatBag
count
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 FloatBag
topOccurrences
in interface MutableFloatBag
public MutableList<FloatIntPair> bottomOccurrences(int count)
MutableFloatBag
count
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 FloatBag
bottomOccurrences
in interface MutableFloatBag
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)
FloatIterable
forEach
in interface FloatIterable
public void each(FloatProcedure procedure)
FloatIterable
each
in interface FloatIterable
public FloatHashBag select(FloatPredicate predicate)
FloatIterable
select
in interface FloatBag
select
in interface FloatIterable
select
in interface MutableFloatBag
select
in interface MutableFloatCollection
public FloatHashBag reject(FloatPredicate predicate)
FloatIterable
reject
in interface FloatBag
reject
in interface FloatIterable
reject
in interface MutableFloatBag
reject
in interface MutableFloatCollection
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)
injectInto
in interface FloatIterable
public boolean equals(java.lang.Object otherBag)
FloatBag
Bag.equals(Object)
.public int hashCode()
FloatBag
Bag.hashCode()
.public void appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public int count(FloatPredicate predicate)
FloatIterable
count
in interface FloatIterable
public boolean anySatisfy(FloatPredicate predicate)
FloatIterable
anySatisfy
in interface FloatIterable
public boolean allSatisfy(FloatPredicate predicate)
FloatIterable
allSatisfy
in interface FloatIterable
public boolean noneSatisfy(FloatPredicate predicate)
FloatIterable
noneSatisfy
in interface FloatIterable
public float detectIfNone(FloatPredicate predicate, float ifNone)
detectIfNone
in interface FloatIterable
public <V> MutableBag<V> collect(FloatToObjectFunction<? extends V> function)
FloatIterable
collect
in interface FloatBag
collect
in interface FloatIterable
collect
in interface MutableFloatBag
collect
in interface MutableFloatCollection
public float max()
max
in interface FloatIterable
public float min()
min
in interface FloatIterable
public double sum()
sum
in interface FloatIterable
public float[] toArray()
FloatIterable
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()
FloatIterable
floatIterator
in interface FloatIterable
floatIterator
in interface MutableFloatCollection
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
in interface java.io.Externalizable
java.io.IOException
Copyright © 2004–2017. All rights reserved.