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 classFloatHashSet.ImmutableFloatHashSet.InternalFloatIterator
-
Field Summary
Fields Modifier and Type Field Description private intoccupiedprivate static longserialVersionUIDprivate float[]tableprivate intzeroToThirtyOneprivate intzeroToThirtyOneOccupied
-
Constructor Summary
Constructors Modifier Constructor Description privateImmutableFloatHashSet(float[] table, int occupied, int zeroToThirtyOne, int zeroToThirtyOneOccupied)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(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 voidcheckOptimizedSize(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.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.FloatIteratorfloatIterator()Returns a primitive iterator that can be used to iterate over the FloatIterable in an imperative style.inthashCode()Follows the same general contract asSet.hashCode().<T> TinjectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)private intmask(int spread)floatmax()floatmin()static ImmutableFloatSetnewSetWith(float... elements)booleannoneSatisfy(FloatPredicate predicate)Returns true if none of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.(package private) intprobe(float element)(package private) intprobeThree(float element, int removedIndex)(package private) intprobeTwo(float element, int removedIndex)ImmutableFloatSetreject(FloatPredicate predicate)Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.ImmutableFloatSetselect(FloatPredicate predicate)Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.intsize()Returns the number of items in this iterable.(package private) intspreadAndMask(float element)(package private) intspreadTwoAndMask(float element)doublesum()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.ObjectwriteReplace()-
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: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
public void appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)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
-
floatIterator
public FloatIterator 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
-
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
-
each
public void each(FloatProcedure procedure)
Description copied from interface:FloatIterableA synonym for forEach.- Specified by:
eachin interfaceFloatIterable
-
select
public ImmutableFloatSet select(FloatPredicate predicate)
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 interfaceImmutableFloatCollection- Specified by:
selectin interfaceImmutableFloatSet
-
reject
public ImmutableFloatSet reject(FloatPredicate predicate)
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 interfaceImmutableFloatCollection- Specified by:
rejectin interfaceImmutableFloatSet
-
collect
public <V> ImmutableSet<V> collect(FloatToObjectFunction<? extends V> function)
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 interfaceImmutableFloatCollection- Specified by:
collectin interfaceImmutableFloatSet
-
detectIfNone
public float detectIfNone(FloatPredicate predicate, float ifNone)
- Specified by:
detectIfNonein interfaceFloatIterable
-
count
public int count(FloatPredicate predicate)
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
public boolean anySatisfy(FloatPredicate predicate)
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
public boolean allSatisfy(FloatPredicate predicate)
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
public boolean noneSatisfy(FloatPredicate predicate)
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
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin 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)
-
-