Class FloatHashSet.ImmutableFloatHashSet
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractFloatIterable
-
- org.eclipse.collections.impl.set.primitive.AbstractFloatSet
-
- org.eclipse.collections.impl.set.immutable.primitive.AbstractImmutableFloatSet
-
- org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet.ImmutableFloatHashSet
-
- All Implemented Interfaces:
java.io.Serializable
,ImmutableFloatCollection
,FloatIterable
,PrimitiveIterable
,FloatSet
,ImmutableFloatSet
- Enclosing class:
- FloatHashSet
private static final class FloatHashSet.ImmutableFloatHashSet extends AbstractImmutableFloatSet implements java.io.Serializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
FloatHashSet.ImmutableFloatHashSet.InternalFloatIterator
-
Field Summary
Fields Modifier and Type Field Description private int
occupied
private static long
serialVersionUID
private float[]
table
private int
zeroToThirtyOne
private int
zeroToThirtyOneOccupied
-
Constructor Summary
Constructors Modifier Constructor Description private
ImmutableFloatHashSet(float[] table, int occupied, int zeroToThirtyOne, int zeroToThirtyOneOccupied)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 givenAppendable
.private void
checkOptimizedSize(int length)
<V> ImmutableSet<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.FloatIterator
floatIterator()
Returns a primitive iterator that can be used to iterate over the FloatIterable in an imperative style.int
hashCode()
Follows the same general contract asSet.hashCode()
.<T> T
injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)
private int
mask(int spread)
float
max()
float
min()
static ImmutableFloatSet
newSetWith(float... elements)
boolean
noneSatisfy(FloatPredicate predicate)
Returns true if none of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.(package private) int
probe(float element)
(package private) int
probeThree(float element, int removedIndex)
(package private) int
probeTwo(float element, int removedIndex)
ImmutableFloatSet
reject(FloatPredicate predicate)
Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.ImmutableFloatSet
select(FloatPredicate predicate)
Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.int
size()
Returns the number of items in this iterable.(package private) int
spreadAndMask(float element)
(package private) int
spreadTwoAndMask(float element)
double
sum()
float[]
toArray()
Converts the FloatIterable to a primitive float array.float[]
toArray(float[] array)
Converts the FloatIterable to a primitive float array.private java.lang.Object
writeReplace()
-
Methods inherited from class org.eclipse.collections.impl.set.immutable.primitive.AbstractImmutableFloatSet
chunk, freeze, newWith, newWithAll, newWithout, newWithoutAll, toImmutable
-
Methods inherited from class org.eclipse.collections.impl.set.primitive.AbstractFloatSet
cartesianProduct, equals
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractFloatIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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.set.primitive.FloatSet
cartesianProduct, equals, isProperSubsetOf, isSubsetOf, tap
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.ImmutableFloatSet
difference, intersect, symmetricDifference, tap, union
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
table
private final float[] table
-
occupied
private final int occupied
-
zeroToThirtyOne
private final int zeroToThirtyOne
-
zeroToThirtyOneOccupied
private final int zeroToThirtyOneOccupied
-
-
Method Detail
-
checkOptimizedSize
private void checkOptimizedSize(int length)
-
newSetWith
public static ImmutableFloatSet newSetWith(float... elements)
-
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
public void appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)
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
-
floatIterator
public FloatIterator 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
-
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
-
each
public void each(FloatProcedure procedure)
Description copied from interface:FloatIterable
A synonym for forEach.- Specified by:
each
in interfaceFloatIterable
-
select
public ImmutableFloatSet select(FloatPredicate predicate)
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 interfaceImmutableFloatCollection
- Specified by:
select
in interfaceImmutableFloatSet
-
reject
public ImmutableFloatSet reject(FloatPredicate predicate)
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 interfaceImmutableFloatCollection
- Specified by:
reject
in interfaceImmutableFloatSet
-
collect
public <V> ImmutableSet<V> collect(FloatToObjectFunction<? extends V> function)
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 interfaceImmutableFloatCollection
- Specified by:
collect
in interfaceImmutableFloatSet
-
detectIfNone
public float detectIfNone(FloatPredicate predicate, float ifNone)
- Specified by:
detectIfNone
in interfaceFloatIterable
-
count
public int count(FloatPredicate predicate)
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
public boolean anySatisfy(FloatPredicate predicate)
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
public boolean allSatisfy(FloatPredicate predicate)
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
public boolean noneSatisfy(FloatPredicate predicate)
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
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)
- Specified by:
injectInto
in interfaceFloatIterable
-
writeReplace
private java.lang.Object writeReplace()
-
probe
int probe(float element)
-
probeTwo
int probeTwo(float element, int removedIndex)
-
probeThree
int probeThree(float element, int removedIndex)
-
spreadAndMask
int spreadAndMask(float element)
-
spreadTwoAndMask
int spreadTwoAndMask(float element)
-
mask
private int mask(int spread)
-
-