Class FloatHashSet
java.lang.Object
org.eclipse.collections.impl.primitive.AbstractFloatIterable
org.eclipse.collections.impl.set.primitive.AbstractFloatSet
org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet
- All Implemented Interfaces:
Externalizable
,Serializable
,MutableFloatCollection
,FloatIterable
,PrimitiveIterable
,FloatSet
,MutableFloatSet
public class FloatHashSet extends AbstractFloatSet implements MutableFloatSet, Externalizable
This file was automatically generated from template file primitiveHashSet.stg.
- Since:
- 3.0.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description FloatHashSet()
FloatHashSet(float... elements)
FloatHashSet(int initialCapacity)
FloatHashSet(FloatHashSet set)
-
Method Summary
Modifier and Type Method Description boolean
add(float element)
boolean
addAll(float... source)
boolean
addAll(FloatIterable source)
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(Appendable appendable, String start, String separator, String end)
Prints a string representation of this collection onto the givenAppendable
.MutableFloatSet
asSynchronized()
MutableFloatSet
asUnmodifiable()
RichIterable<FloatIterable>
chunk(int size)
Partitions elements in fixed size chunks.void
clear()
<V> MutableSet<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.<V, R extends Collection<V>>
Rcollect(FloatToObjectFunction<? extends V> function, R target)
Same asFloatIterable.collect(FloatToObjectFunction)
, only the results are added to the target Collection.void
compact()
Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.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.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.FloatSet
freeze()
Returns a frozen copy of this set.int
hashCode()
Follows the same general contract asSet.hashCode()
.<T> T
injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)
float
max()
float
min()
FloatHashSet
newEmpty()
Creates a new empty FloatHashSet.static FloatHashSet
newSet(FloatIterable source)
static FloatHashSet
newSetWith(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.void
readExternal(ObjectInput in)
FloatHashSet
reject(FloatPredicate predicate)
Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.<R extends MutableFloatCollection>
Rreject(FloatPredicate predicate, R target)
Same asFloatIterable.reject(FloatPredicate)
, only the results are added to the target MutableFloatCollection.boolean
remove(float value)
boolean
removeAll(float... source)
boolean
removeAll(FloatIterable source)
boolean
retainAll(float... source)
boolean
retainAll(FloatIterable source)
FloatHashSet
select(FloatPredicate predicate)
Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.<R extends MutableFloatCollection>
Rselect(FloatPredicate predicate, R target)
Same asFloatIterable.select(FloatPredicate)
, only the results are added to the target MutableFloatCollection.int
size()
Returns the number of items in this iterable.double
sum()
float[]
toArray()
Converts the FloatIterable to a primitive float array.float[]
toArray(float[] array)
Converts the FloatIterable to a primitive float array.ImmutableFloatSet
toImmutable()
Returns an immutable copy of this set.FloatHashSet
with(float element)
FloatHashSet
withAll(FloatIterable elements)
FloatHashSet
without(float element)
FloatHashSet
withoutAll(FloatIterable elements)
void
writeExternal(ObjectOutput out)
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractFloatIterable
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
Methods inherited from interface org.eclipse.collections.api.FloatIterable
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableFloatCollection
removeIf
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
-
Constructor Details
-
FloatHashSet
public FloatHashSet() -
FloatHashSet
public FloatHashSet(int initialCapacity) -
FloatHashSet
public FloatHashSet(float... elements) -
FloatHashSet
-
-
Method Details
-
newSet
-
newSetWith
-
hashCode
public int hashCode()Description copied from interface:FloatSet
Follows the same general contract asSet.hashCode()
.- Specified by:
hashCode
in interfaceFloatSet
- Specified by:
hashCode
in classAbstractFloatSet
-
size
public int size()Description copied from interface:PrimitiveIterable
Returns the number of items in this iterable.- Specified by:
size
in interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString(String, String, String)
.- Specified by:
appendString
in interfacePrimitiveIterable
-
add
public boolean add(float element)- Specified by:
add
in interfaceMutableFloatCollection
-
addAll
public boolean addAll(float... source)- Specified by:
addAll
in interfaceMutableFloatCollection
-
addAll
- Specified by:
addAll
in interfaceMutableFloatCollection
-
remove
public boolean remove(float value)- Specified by:
remove
in interfaceMutableFloatCollection
-
removeAll
- Specified by:
removeAll
in interfaceMutableFloatCollection
-
removeAll
public boolean removeAll(float... source)- Specified by:
removeAll
in interfaceMutableFloatCollection
-
retainAll
- Specified by:
retainAll
in interfaceMutableFloatCollection
- See Also:
Collection.retainAll(Collection)
-
retainAll
public boolean retainAll(float... source)- Specified by:
retainAll
in interfaceMutableFloatCollection
- See Also:
Collection.retainAll(Collection)
-
clear
public void clear()- Specified by:
clear
in interfaceMutableFloatCollection
-
with
- Specified by:
with
in interfaceMutableFloatCollection
- Specified by:
with
in interfaceMutableFloatSet
-
without
- Specified by:
without
in interfaceMutableFloatCollection
- Specified by:
without
in interfaceMutableFloatSet
-
withAll
- Specified by:
withAll
in interfaceMutableFloatCollection
- Specified by:
withAll
in interfaceMutableFloatSet
-
withoutAll
- Specified by:
withoutAll
in interfaceMutableFloatCollection
- Specified by:
withoutAll
in interfaceMutableFloatSet
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableFloatCollection
- Specified by:
asUnmodifiable
in interfaceMutableFloatSet
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableFloatCollection
- Specified by:
asSynchronized
in interfaceMutableFloatSet
-
toImmutable
Description copied from interface:MutableFloatSet
Returns an immutable copy of this set.- Specified by:
toImmutable
in interfaceFloatSet
- Specified by:
toImmutable
in interfaceMutableFloatCollection
- Specified by:
toImmutable
in interfaceMutableFloatSet
-
floatIterator
Description copied from interface:FloatIterable
Returns a primitive iterator that can be used to iterate over the FloatIterable in an imperative style.- Specified by:
floatIterator
in interfaceFloatIterable
- Specified by:
floatIterator
in interfaceMutableFloatCollection
-
toArray
public float[] toArray()Description copied from interface:FloatIterable
Converts the FloatIterable to a primitive float array.- Specified by:
toArray
in interfaceFloatIterable
-
toArray
public float[] toArray(float[] array)Description copied from interface:FloatIterable
Converts the FloatIterable to a primitive float array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.- Specified by:
toArray
in interfaceFloatIterable
-
contains
public boolean contains(float value)Description copied from interface:FloatIterable
Returns true if the value is contained in the FloatIterable, and false if it is not.- Specified by:
contains
in interfaceFloatIterable
-
forEach
Description copied from interface:FloatIterable
Applies the FloatProcedure to each element in the FloatIterable.- Specified by:
forEach
in interfaceFloatIterable
-
each
Description copied from interface:FloatIterable
A synonym for forEach.- Specified by:
each
in interfaceFloatIterable
- Since:
- 7.0.
-
select
Description copied from interface:FloatIterable
Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.- Specified by:
select
in interfaceFloatIterable
- Specified by:
select
in interfaceFloatSet
- Specified by:
select
in interfaceMutableFloatCollection
- Specified by:
select
in interfaceMutableFloatSet
-
select
Description copied from interface:FloatIterable
Same asFloatIterable.select(FloatPredicate)
, only the results are added to the target MutableFloatCollection.- Specified by:
select
in interfaceFloatIterable
- Since:
- 8.1.
-
reject
Description copied from interface:FloatIterable
Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.- Specified by:
reject
in interfaceFloatIterable
- Specified by:
reject
in interfaceFloatSet
- Specified by:
reject
in interfaceMutableFloatCollection
- Specified by:
reject
in interfaceMutableFloatSet
-
reject
Description copied from interface:FloatIterable
Same asFloatIterable.reject(FloatPredicate)
, only the results are added to the target MutableFloatCollection.- Specified by:
reject
in interfaceFloatIterable
- Since:
- 8.1.
-
collect
Description copied from interface:FloatIterable
Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collect
in interfaceFloatIterable
- Specified by:
collect
in interfaceFloatSet
- Specified by:
collect
in interfaceMutableFloatCollection
- Specified by:
collect
in interfaceMutableFloatSet
-
collect
public <V, R extends Collection<V>> R collect(FloatToObjectFunction<? extends V> function, R target)Description copied from interface:FloatIterable
Same asFloatIterable.collect(FloatToObjectFunction)
, only the results are added to the target Collection.- Specified by:
collect
in interfaceFloatIterable
- Since:
- 8.1.
-
detectIfNone
- Specified by:
detectIfNone
in interfaceFloatIterable
-
count
Description copied from interface:FloatIterable
Returns a count of the number of elements in the FloatIterable that return true for the specified predicate.- Specified by:
count
in interfaceFloatIterable
-
anySatisfy
Description copied from interface:FloatIterable
Returns true if any of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfy
in interfaceFloatIterable
-
allSatisfy
Description copied from interface:FloatIterable
Returns true if all of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfy
in interfaceFloatIterable
-
noneSatisfy
Description copied from interface:FloatIterable
Returns true if none of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfy
in interfaceFloatIterable
-
sum
public double sum()- Specified by:
sum
in interfaceFloatIterable
-
max
public float max()- Specified by:
max
in interfaceFloatIterable
-
min
public float min()- Specified by:
min
in interfaceFloatIterable
-
freeze
Description copied from interface:MutableFloatSet
Returns a frozen copy of this set. A frozen copy is the same thing as an immutable copy without safe-publish guarantees.- Specified by:
freeze
in interfaceFloatSet
- Specified by:
freeze
in interfaceMutableFloatSet
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)- Specified by:
injectInto
in interfaceFloatIterable
-
chunk
Description copied from interface:FloatIterable
Partitions elements in fixed size chunks.- Specified by:
chunk
in interfaceFloatIterable
- Parameters:
size
- the number of elements per chunk- Returns:
- A
RichIterable
containingFloatIterable
s of sizesize
, except the last will be truncated if the elements don't divide evenly.
-
newEmpty
Creates a new empty FloatHashSet.- Specified by:
newEmpty
in interfaceMutableFloatCollection
- Specified by:
newEmpty
in interfaceMutableFloatSet
- Since:
- 9.2.
-
compact
public void compact()Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
-