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:
Serializable
,ImmutableFloatCollection
,FloatIterable
,PrimitiveIterable
,FloatSet
,ImmutableFloatSet
- Enclosing class:
FloatHashSet
private static final class FloatHashSet.ImmutableFloatHashSet
extends AbstractImmutableFloatSet
implements Serializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private static final long
private final float[]
private final int
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ImmutableFloatHashSet
(float[] table, int occupied, int zeroToThirtyOne, int zeroToThirtyOneOccupied) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
.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.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) reject
(FloatPredicate predicate) Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.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 Object
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 Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
table
private final float[] table -
occupied
private final int occupied -
zeroToThirtyOne
private final int zeroToThirtyOne -
zeroToThirtyOneOccupied
private final int zeroToThirtyOneOccupied
-
-
Constructor Details
-
ImmutableFloatHashSet
private ImmutableFloatHashSet(float[] table, int occupied, int zeroToThirtyOne, int zeroToThirtyOneOccupied)
-
-
Method Details
-
checkOptimizedSize
private void checkOptimizedSize(int length) -
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
-
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
Description copied from interface:FloatIterable
A synonym for forEach.- Specified by:
each
in interfaceFloatIterable
-
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 interfaceImmutableFloatCollection
- Specified by:
select
in interfaceImmutableFloatSet
-
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 interfaceImmutableFloatCollection
- Specified by:
reject
in interfaceImmutableFloatSet
-
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 interfaceImmutableFloatCollection
- Specified by:
collect
in interfaceImmutableFloatSet
-
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
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T, ? extends T> function) - Specified by:
injectInto
in interfaceFloatIterable
-
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)
-