Top Description Inners Fields Constructors Methods
org.eclipse.collections.impl.bag.mutable.primitive

public Class FloatHashBag

extends AbstractFloatIterable
implements MutableFloatBag, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, org.eclipse.collections.api.bag.primitive.MutableFloatBag, org.eclipse.collections.api.bag.primitive.FloatBag, org.eclipse.collections.api.FloatIterable, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.api.collection.primitive.MutableFloatCollection
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, java.util.NoSuchElementException, org.eclipse.collections.api.FloatIterable, .RichIterable, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.bag.primitive.FloatBag, .ImmutableFloatBag, .MutableFloatBag, org.eclipse.collections.api.block.function.primitive.FloatToObjectFunction, .IntFunction, .ObjectFloatToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.IntPredicate, .FloatPredicate, org.eclipse.collections.api.block.procedure.primitive.FloatProcedure, .FloatIntProcedure, org.eclipse.collections.api.factory.Lists, org.eclipse.collections.api.iterator.FloatIterator, .MutableFloatIterator, org.eclipse.collections.api.set.primitive.FloatSet, .MutableFloatSet, org.eclipse.collections.api.tuple.primitive.FloatIntPair, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.impl.Counter, org.eclipse.collections.impl.bag.mutable.HashBag, org.eclipse.collections.impl.block.factory.primitive.IntToIntFunctions, org.eclipse.collections.impl.factory.primitive.FloatBags, .FloatSets, org.eclipse.collections.impl.map.mutable.primitive.FloatIntHashMap, org.eclipse.collections.impl.primitive.AbstractFloatIterable, org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet, org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples

FloatHashBag is similar to HashBag, and is memory-optimized for float primitives. This file was automatically generated from template file primitiveHashBag.stg.
Since
3.0.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private FloatIntHashMap
private static final long
private int

Constructor Summary

AccessConstructor and Description
public
public
FloatHashBag(int size)

public
public
FloatHashBag(float... elements)

public

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public boolean
public void
public boolean
allSatisfy(FloatPredicate predicate)

Implements org.eclipse.collections.api.FloatIterable.allSatisfy.

Returns true if all of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.

public boolean
anySatisfy(FloatPredicate predicate)

Implements org.eclipse.collections.api.FloatIterable.anySatisfy.

Returns true if any of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.

public void
appendString(Appendable appendable, String start, String separator, String end)

Implements org.eclipse.collections.api.PrimitiveIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public MutableFloatBag
public MutableFloatBag
public MutableList<FloatIntPair>
bottomOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableFloatBag.bottomOccurrences.

Returns the count least frequently occurring items.

public RichIterable<FloatIterable>
chunk(int size)

Overrides default org.eclipse.collections.api.FloatIterable.chunk.

Partitions elements in fixed size chunks.

public void
public <V> MutableBag<V>
collect(FloatToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.bag.primitive.MutableFloatBag.collect, org.eclipse.collections.api.FloatIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public boolean
contains(float value)

Implements org.eclipse.collections.api.FloatIterable.contains.

Returns true if the value is contained in the FloatIterable, and false if it is not.

public int
count(FloatPredicate predicate)

Implements org.eclipse.collections.api.FloatIterable.count.

Returns a count of the number of elements in the FloatIterable that return true for the specified predicate.

public float
public void
each(FloatProcedure procedure)

Implements org.eclipse.collections.api.FloatIterable.each.

A synonym for forEach.

public boolean
equals(Object otherBag)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.bag.primitive.FloatBag.equals.

Follows the same general contract as Bag#equals(Object).

public MutableFloatIterator
floatIterator()

Implements org.eclipse.collections.api.collection.primitive.MutableFloatCollection.floatIterator, org.eclipse.collections.api.FloatIterable.floatIterator.

Returns a primitive iterator that can be used to iterate over the FloatIterable in an imperative style.

public void
forEachWithOccurrences(FloatIntProcedure procedure)

Implements org.eclipse.collections.api.bag.primitive.FloatBag.forEachWithOccurrences.

For each distinct item, with the number of occurrences, execute the specified procedure.

public int
public <T> T
injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T, ? extends T> function)

Implements org.eclipse.collections.api.FloatIterable.injectInto.

public boolean
isEmpty()

Overrides default org.eclipse.collections.api.PrimitiveIterable.isEmpty.

Returns true if this iterable has zero items.

public float
public float
public static FloatHashBag
newBag(int size)

public static FloatHashBag
public static FloatHashBag
newBag(FloatBag source)

public static FloatHashBag
newBagWith(float... source)

public FloatHashBag
newEmpty()

Overrides default org.eclipse.collections.api.bag.primitive.MutableFloatBag.newEmpty.

Creates a new empty FloatHashBag.

public boolean
noneSatisfy(FloatPredicate predicate)

Overrides default org.eclipse.collections.api.FloatIterable.noneSatisfy.

Returns true if none of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.

public boolean
notEmpty()

Overrides default org.eclipse.collections.api.PrimitiveIterable.notEmpty.

The English equivalent of !this.isEmpty()

public int
occurrencesOf(float item)

Implements org.eclipse.collections.api.bag.primitive.FloatBag.occurrencesOf.

The occurrences of a distinct item in the bag.

protected MutableList<FloatIntPair>
public void
readExternal(ObjectInput in)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public FloatHashBag
reject(FloatPredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableFloatBag.reject, org.eclipse.collections.api.FloatIterable.reject.

Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public FloatHashBag
select(FloatPredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableFloatBag.select, org.eclipse.collections.api.FloatIterable.select.

Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.

public FloatHashBag
selectByOccurrences(IntPredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableFloatBag.selectByOccurrences.

Returns all elements of the bag that have a number of occurrences that satisfy the predicate.

public MutableFloatSet
selectUnique()

Implements org.eclipse.collections.api.bag.primitive.MutableFloatBag.selectUnique.

Returns all elements of the bag that have exactly one occurrence.

public int
size()

Implements org.eclipse.collections.api.PrimitiveIterable.size.

Returns the number of items in this iterable.

public int
sizeDistinct()

Implements org.eclipse.collections.api.bag.primitive.FloatBag.sizeDistinct.

The size of the Bag when counting only distinct elements.

public double
public float[]
toArray()

Implements org.eclipse.collections.api.FloatIterable.toArray.

Converts the FloatIterable to a primitive float array.

public float[]
toArray(float[] array)

Overrides default org.eclipse.collections.api.FloatIterable.toArray.

Converts the FloatIterable to a primitive float array.

public ImmutableFloatBag
toImmutable()

Implements org.eclipse.collections.api.bag.primitive.MutableFloatBag.toImmutable.

Returns an immutable copy of this bag.

protected MutableList<FloatIntPair>
public MutableList<FloatIntPair>
topOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableFloatBag.topOccurrences.

Returns the count most frequently occurring items.

public FloatHashBag
public FloatHashBag
with(float element1, float element2)

public FloatHashBag
with(float element1, float element2, float element3)

public FloatHashBag
public FloatHashBag
public FloatHashBag
public void
writeExternal(ObjectOutput out)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.eclipse.collections.impl.primitive.AbstractFloatIterable:
asLazyaveragemaxIfEmptymedianminIfEmptytoBagtoListtoSettoSortedArraytoSortedListtoString