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 booleanadd(float element)booleanaddAll(float... source)booleanaddAll(FloatIterable source)booleanallSatisfy(FloatPredicate predicate)Returns true if all of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.booleananySatisfy(FloatPredicate predicate)Returns true if any of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.voidappendString(Appendable appendable, String start, String separator, String end)Prints a string representation of this collection onto the givenAppendable.MutableFloatSetasSynchronized()MutableFloatSetasUnmodifiable()RichIterable<FloatIterable>chunk(int size)Partitions elements in fixed size chunks.voidclear()<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.voidcompact()Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.booleancontains(float value)Returns true if the value is contained in the FloatIterable, and false if it is not.intcount(FloatPredicate predicate)Returns a count of the number of elements in the FloatIterable that return true for the specified predicate.floatdetectIfNone(FloatPredicate predicate, float ifNone)voideach(FloatProcedure procedure)A synonym for forEach.MutableFloatIteratorfloatIterator()Returns a primitive iterator that can be used to iterate over the FloatIterable in an imperative style.voidforEach(FloatProcedure procedure)Applies the FloatProcedure to each element in the FloatIterable.FloatSetfreeze()Returns a frozen copy of this set.inthashCode()Follows the same general contract asSet.hashCode().<T> TinjectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)floatmax()floatmin()FloatHashSetnewEmpty()Creates a new empty FloatHashSet.static FloatHashSetnewSet(FloatIterable source)static FloatHashSetnewSetWith(float... source)booleannoneSatisfy(FloatPredicate predicate)Returns true if none of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.voidreadExternal(ObjectInput in)FloatHashSetreject(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.booleanremove(float value)booleanremoveAll(float... source)booleanremoveAll(FloatIterable source)booleanretainAll(float... source)booleanretainAll(FloatIterable source)FloatHashSetselect(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.intsize()Returns the number of items in this iterable.doublesum()float[]toArray()Converts the FloatIterable to a primitive float array.float[]toArray(float[] array)Converts the FloatIterable to a primitive float array.ImmutableFloatSettoImmutable()Returns an immutable copy of this set.FloatHashSetwith(float element)FloatHashSetwithAll(FloatIterable elements)FloatHashSetwithout(float element)FloatHashSetwithoutAll(FloatIterable elements)voidwriteExternal(ObjectOutput out)Methods inherited from class org.eclipse.collections.impl.primitive.AbstractFloatIterable
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringMethods 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, toSortedListMethods inherited from interface org.eclipse.collections.api.collection.primitive.MutableFloatCollection
removeIfMethods 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:FloatSetFollows the same general contract asSet.hashCode().- Specified by:
hashCodein interfaceFloatSet- Specified by:
hashCodein classAbstractFloatSet
-
size
public int size()Description copied from interface:PrimitiveIterableReturns the number of items in this iterable.- Specified by:
sizein interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString(String, String, String).- Specified by:
appendStringin interfacePrimitiveIterable
-
add
public boolean add(float element)- Specified by:
addin interfaceMutableFloatCollection
-
addAll
public boolean addAll(float... source)- Specified by:
addAllin interfaceMutableFloatCollection
-
addAll
- Specified by:
addAllin interfaceMutableFloatCollection
-
remove
public boolean remove(float value)- Specified by:
removein interfaceMutableFloatCollection
-
removeAll
- Specified by:
removeAllin interfaceMutableFloatCollection
-
removeAll
public boolean removeAll(float... source)- Specified by:
removeAllin interfaceMutableFloatCollection
-
retainAll
- Specified by:
retainAllin interfaceMutableFloatCollection- See Also:
Collection.retainAll(Collection)
-
retainAll
public boolean retainAll(float... source)- Specified by:
retainAllin interfaceMutableFloatCollection- See Also:
Collection.retainAll(Collection)
-
clear
public void clear()- Specified by:
clearin interfaceMutableFloatCollection
-
with
- Specified by:
within interfaceMutableFloatCollection- Specified by:
within interfaceMutableFloatSet
-
without
- Specified by:
withoutin interfaceMutableFloatCollection- Specified by:
withoutin interfaceMutableFloatSet
-
withAll
- Specified by:
withAllin interfaceMutableFloatCollection- Specified by:
withAllin interfaceMutableFloatSet
-
withoutAll
- Specified by:
withoutAllin interfaceMutableFloatCollection- Specified by:
withoutAllin interfaceMutableFloatSet
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableFloatCollection- Specified by:
asUnmodifiablein interfaceMutableFloatSet
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableFloatCollection- Specified by:
asSynchronizedin interfaceMutableFloatSet
-
toImmutable
Description copied from interface:MutableFloatSetReturns an immutable copy of this set.- Specified by:
toImmutablein interfaceFloatSet- Specified by:
toImmutablein interfaceMutableFloatCollection- Specified by:
toImmutablein interfaceMutableFloatSet
-
floatIterator
Description copied from interface:FloatIterableReturns a primitive iterator that can be used to iterate over the FloatIterable in an imperative style.- Specified by:
floatIteratorin interfaceFloatIterable- Specified by:
floatIteratorin interfaceMutableFloatCollection
-
toArray
public float[] toArray()Description copied from interface:FloatIterableConverts the FloatIterable to a primitive float array.- Specified by:
toArrayin interfaceFloatIterable
-
toArray
public float[] toArray(float[] array)Description copied from interface:FloatIterableConverts 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:
toArrayin interfaceFloatIterable
-
contains
public boolean contains(float value)Description copied from interface:FloatIterableReturns true if the value is contained in the FloatIterable, and false if it is not.- Specified by:
containsin interfaceFloatIterable
-
forEach
Description copied from interface:FloatIterableApplies the FloatProcedure to each element in the FloatIterable.- Specified by:
forEachin interfaceFloatIterable
-
each
Description copied from interface:FloatIterableA synonym for forEach.- Specified by:
eachin interfaceFloatIterable- Since:
- 7.0.
-
select
Description copied from interface:FloatIterableReturns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.- Specified by:
selectin interfaceFloatIterable- Specified by:
selectin interfaceFloatSet- Specified by:
selectin interfaceMutableFloatCollection- Specified by:
selectin interfaceMutableFloatSet
-
select
Description copied from interface:FloatIterableSame asFloatIterable.select(FloatPredicate), only the results are added to the target MutableFloatCollection.- Specified by:
selectin interfaceFloatIterable- Since:
- 8.1.
-
reject
Description copied from interface:FloatIterableReturns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.- Specified by:
rejectin interfaceFloatIterable- Specified by:
rejectin interfaceFloatSet- Specified by:
rejectin interfaceMutableFloatCollection- Specified by:
rejectin interfaceMutableFloatSet
-
reject
Description copied from interface:FloatIterableSame asFloatIterable.reject(FloatPredicate), only the results are added to the target MutableFloatCollection.- Specified by:
rejectin interfaceFloatIterable- Since:
- 8.1.
-
collect
Description copied from interface:FloatIterableReturns 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:
collectin interfaceFloatIterable- Specified by:
collectin interfaceFloatSet- Specified by:
collectin interfaceMutableFloatCollection- Specified by:
collectin interfaceMutableFloatSet
-
collect
public <V, R extends Collection<V>> R collect(FloatToObjectFunction<? extends V> function, R target)Description copied from interface:FloatIterableSame asFloatIterable.collect(FloatToObjectFunction), only the results are added to the target Collection.- Specified by:
collectin interfaceFloatIterable- Since:
- 8.1.
-
detectIfNone
- Specified by:
detectIfNonein interfaceFloatIterable
-
count
Description copied from interface:FloatIterableReturns a count of the number of elements in the FloatIterable that return true for the specified predicate.- Specified by:
countin interfaceFloatIterable
-
anySatisfy
Description copied from interface:FloatIterableReturns true if any of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfyin interfaceFloatIterable
-
allSatisfy
Description copied from interface:FloatIterableReturns true if all of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfyin interfaceFloatIterable
-
noneSatisfy
Description copied from interface:FloatIterableReturns true if none of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfyin interfaceFloatIterable
-
sum
public double sum()- Specified by:
sumin interfaceFloatIterable
-
max
public float max()- Specified by:
maxin interfaceFloatIterable
-
min
public float min()- Specified by:
minin interfaceFloatIterable
-
freeze
Description copied from interface:MutableFloatSetReturns a frozen copy of this set. A frozen copy is the same thing as an immutable copy without safe-publish guarantees.- Specified by:
freezein interfaceFloatSet- Specified by:
freezein interfaceMutableFloatSet
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceFloatIterable
-
chunk
Description copied from interface:FloatIterablePartitions elements in fixed size chunks.- Specified by:
chunkin interfaceFloatIterable- Parameters:
size- the number of elements per chunk- Returns:
- A
RichIterablecontainingFloatIterables of sizesize, except the last will be truncated if the elements don't divide evenly.
-
newEmpty
Creates a new empty FloatHashSet.- Specified by:
newEmptyin interfaceMutableFloatCollection- Specified by:
newEmptyin 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.
-