Class FloatHashBag
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractFloatIterable
-
- org.eclipse.collections.impl.bag.mutable.primitive.FloatHashBag
-
- All Implemented Interfaces:
Externalizable,Serializable,FloatBag,MutableFloatBag,MutableFloatCollection,FloatIterable,PrimitiveIterable
public class FloatHashBag extends AbstractFloatIterable implements MutableFloatBag, Externalizable
FloatHashBag is similar toHashBag, and is memory-optimized for float primitives. This file was automatically generated from template file primitiveHashBag.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FloatHashBag()FloatHashBag(float... elements)FloatHashBag(int size)FloatHashBag(FloatIterable iterable)FloatHashBag(FloatHashBag bag)
-
Method Summary
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractFloatIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.FloatBag
toStringOfItemToCount
-
Methods inherited from interface org.eclipse.collections.api.FloatIterable
asLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableFloatBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
-
-
-
Constructor Detail
-
FloatHashBag
public FloatHashBag()
-
FloatHashBag
public FloatHashBag(int size)
-
FloatHashBag
public FloatHashBag(FloatIterable iterable)
-
FloatHashBag
public FloatHashBag(float... elements)
-
FloatHashBag
public FloatHashBag(FloatHashBag bag)
-
-
Method Detail
-
newBag
public static FloatHashBag newBag(int size)
-
newBagWith
public static FloatHashBag newBagWith(float... source)
-
newBag
public static FloatHashBag newBag(FloatIterable source)
-
newBag
public static FloatHashBag newBag(FloatBag source)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmptyin interfacePrimitiveIterable
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
sizeDistinct
public int sizeDistinct()
- Specified by:
sizeDistinctin interfaceFloatBag
-
clear
public void clear()
- Specified by:
clearin interfaceMutableFloatCollection
-
with
public FloatHashBag with(float element)
- Specified by:
within interfaceMutableFloatBag- Specified by:
within interfaceMutableFloatCollection
-
with
public FloatHashBag with(float element1, float element2)
-
with
public FloatHashBag with(float element1, float element2, float element3)
-
withAll
public FloatHashBag withAll(FloatIterable iterable)
- Specified by:
withAllin interfaceMutableFloatBag- Specified by:
withAllin interfaceMutableFloatCollection
-
without
public FloatHashBag without(float element)
- Specified by:
withoutin interfaceMutableFloatBag- Specified by:
withoutin interfaceMutableFloatCollection
-
withoutAll
public FloatHashBag withoutAll(FloatIterable iterable)
- Specified by:
withoutAllin interfaceMutableFloatBag- Specified by:
withoutAllin interfaceMutableFloatCollection
-
contains
public boolean contains(float value)
- Specified by:
containsin interfaceFloatIterable
-
occurrencesOf
public int occurrencesOf(float item)
- Specified by:
occurrencesOfin interfaceFloatBag
-
forEachWithOccurrences
public void forEachWithOccurrences(FloatIntProcedure procedure)
- Specified by:
forEachWithOccurrencesin interfaceFloatBag
-
selectByOccurrences
public FloatHashBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrencesin interfaceFloatBag- Specified by:
selectByOccurrencesin interfaceMutableFloatBag
-
selectUnique
public MutableFloatSet selectUnique()
- Specified by:
selectUniquein interfaceFloatBag- Specified by:
selectUniquein interfaceMutableFloatBag
-
topOccurrences
public MutableList<FloatIntPair> topOccurrences(int count)
- Specified by:
topOccurrencesin interfaceFloatBag- Specified by:
topOccurrencesin interfaceMutableFloatBag
-
bottomOccurrences
public MutableList<FloatIntPair> bottomOccurrences(int count)
- Specified by:
bottomOccurrencesin interfaceFloatBag- Specified by:
bottomOccurrencesin interfaceMutableFloatBag
-
add
public boolean add(float item)
- Specified by:
addin interfaceMutableFloatCollection
-
remove
public boolean remove(float item)
- Specified by:
removein interfaceMutableFloatCollection
-
removeIf
public boolean removeIf(FloatPredicate predicate)
- Specified by:
removeIfin interfaceMutableFloatCollection
-
addAll
public boolean addAll(float... source)
- Specified by:
addAllin interfaceMutableFloatCollection
-
addAll
public boolean addAll(FloatIterable source)
- Specified by:
addAllin interfaceMutableFloatCollection
-
removeAll
public boolean removeAll(float... source)
- Specified by:
removeAllin interfaceMutableFloatCollection
-
removeAll
public boolean removeAll(FloatIterable source)
- Specified by:
removeAllin interfaceMutableFloatCollection
-
retainAll
public boolean retainAll(FloatIterable source)
- Specified by:
retainAllin interfaceMutableFloatCollection
-
retainAll
public boolean retainAll(float... source)
- Specified by:
retainAllin interfaceMutableFloatCollection
-
addOccurrences
public void addOccurrences(float item, int occurrences)- Specified by:
addOccurrencesin interfaceMutableFloatBag
-
removeOccurrences
public boolean removeOccurrences(float item, int occurrences)- Specified by:
removeOccurrencesin interfaceMutableFloatBag
-
each
public void each(FloatProcedure procedure)
- Specified by:
eachin interfaceFloatIterable- Since:
- 7.0.
-
select
public FloatHashBag select(FloatPredicate predicate)
- Specified by:
selectin interfaceFloatBag- Specified by:
selectin interfaceFloatIterable- Specified by:
selectin interfaceMutableFloatBag- Specified by:
selectin interfaceMutableFloatCollection
-
reject
public FloatHashBag reject(FloatPredicate predicate)
- Specified by:
rejectin interfaceFloatBag- Specified by:
rejectin interfaceFloatIterable- Specified by:
rejectin interfaceMutableFloatBag- Specified by:
rejectin interfaceMutableFloatCollection
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceFloatIterable
-
chunk
public RichIterable<FloatIterable> chunk(int size)
- Specified by:
chunkin interfaceFloatIterable
-
equals
public boolean equals(Object otherBag)
-
hashCode
public int hashCode()
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
count
public int count(FloatPredicate predicate)
- Specified by:
countin interfaceFloatIterable
-
anySatisfy
public boolean anySatisfy(FloatPredicate predicate)
- Specified by:
anySatisfyin interfaceFloatIterable
-
allSatisfy
public boolean allSatisfy(FloatPredicate predicate)
- Specified by:
allSatisfyin interfaceFloatIterable
-
noneSatisfy
public boolean noneSatisfy(FloatPredicate predicate)
- Specified by:
noneSatisfyin interfaceFloatIterable
-
detectIfNone
public float detectIfNone(FloatPredicate predicate, float ifNone)
- Specified by:
detectIfNonein interfaceFloatIterable
-
collect
public <V> MutableBag<V> collect(FloatToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceFloatBag- Specified by:
collectin interfaceFloatIterable- Specified by:
collectin interfaceMutableFloatBag- Specified by:
collectin interfaceMutableFloatCollection
-
max
public float max()
- Specified by:
maxin interfaceFloatIterable
-
min
public float min()
- Specified by:
minin interfaceFloatIterable
-
sum
public double sum()
- Specified by:
sumin interfaceFloatIterable
-
toArray
public float[] toArray()
- Specified by:
toArrayin interfaceFloatIterable
-
toArray
public float[] toArray(float[] array)
- Specified by:
toArrayin interfaceFloatIterable
-
asUnmodifiable
public MutableFloatBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableFloatBag- Specified by:
asUnmodifiablein interfaceMutableFloatCollection
-
asSynchronized
public MutableFloatBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableFloatBag- Specified by:
asSynchronizedin interfaceMutableFloatCollection
-
toImmutable
public ImmutableFloatBag toImmutable()
- Specified by:
toImmutablein interfaceFloatBag- Specified by:
toImmutablein interfaceMutableFloatBag- Specified by:
toImmutablein interfaceMutableFloatCollection
-
newEmpty
public FloatHashBag newEmpty()
Creates a new empty FloatHashBag.- Specified by:
newEmptyin interfaceMutableFloatBag- Specified by:
newEmptyin interfaceMutableFloatCollection- Since:
- 9.2.
-
floatIterator
public MutableFloatIterator floatIterator()
- Specified by:
floatIteratorin interfaceFloatIterable- Specified by:
floatIteratorin interfaceMutableFloatCollection
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
-