Class DoubleHashSet.ImmutableDoubleHashSet
java.lang.Object
org.eclipse.collections.impl.primitive.AbstractDoubleIterable
org.eclipse.collections.impl.set.primitive.AbstractDoubleSet
org.eclipse.collections.impl.set.immutable.primitive.AbstractImmutableDoubleSet
org.eclipse.collections.impl.set.mutable.primitive.DoubleHashSet.ImmutableDoubleHashSet
- All Implemented Interfaces:
Serializable, ImmutableDoubleCollection, DoubleIterable, PrimitiveIterable, DoubleSet, ImmutableDoubleSet
- Enclosing class:
DoubleHashSet
private static final class DoubleHashSet.ImmutableDoubleHashSet
extends AbstractImmutableDoubleSet
implements Serializable
- Since:
- 3.0.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate static final longprivate final double[]private final intprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableDoubleHashSet(double[] table, int occupied, int zeroToThirtyOne, int zeroToThirtyOneOccupied) -
Method Summary
Modifier and TypeMethodDescriptionbooleanallSatisfy(DoublePredicate predicate) Returns true if all of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.booleananySatisfy(DoublePredicate predicate) Returns true if any of the elements in the DoubleIterable 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.private voidcheckOptimizedSize(int length) <V> ImmutableSet<V> collect(DoubleToObjectFunction<? extends V> function) Returns a new collection with the results of applying the specified function on each element of the source collection.booleancontains(double value) Returns true if the value is contained in the DoubleIterable, and false if it is not.intcount(DoublePredicate predicate) Returns a count of the number of elements in the DoubleIterable that return true for the specified predicate.doubledetectIfNone(DoublePredicate predicate, double ifNone) Returns a primitive iterator that can be used to iterate over the DoubleIterable in an imperative style.voideach(DoubleProcedure procedure) A synonym for forEach.inthashCode()Follows the same general contract asSet.hashCode().<T> TinjectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T, ? extends T> function) private intmask(int spread) doublemax()doublemin()static ImmutableDoubleSetnewSetWith(double... elements) booleannoneSatisfy(DoublePredicate predicate) Returns true if none of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.(package private) intprobe(double element) (package private) intprobeThree(double element, int removedIndex) (package private) intprobeTwo(double element, int removedIndex) reject(DoublePredicate predicate) Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.select(DoublePredicate predicate) Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.intsize()Returns the number of items in this iterable.(package private) intspreadAndMask(double element) (package private) intspreadTwoAndMask(double element) doublesum()double[]toArray()Converts the DoubleIterable to a primitive double array.double[]toArray(double[] array) Converts the DoubleIterable to a primitive double array.private ObjectMethods inherited from class AbstractImmutableDoubleSet
chunk, freeze, newWith, newWithAll, newWithout, newWithoutAll, toImmutableMethods inherited from class AbstractDoubleSet
cartesianProduct, equalsMethods inherited from class AbstractDoubleIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringMethods inherited from interface DoubleIterable
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, toSortedListByMethods inherited from interface DoubleSet
cartesianProduct, equals, isProperSubsetOf, isSubsetOf, tapMethods inherited from interface ImmutableDoubleSet
difference, intersect, symmetricDifference, tap, unionMethods inherited from interface PrimitiveIterable
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
table
private final double[] table -
occupied
private final int occupied -
zeroToThirtyOne
private final int zeroToThirtyOne -
zeroToThirtyOneOccupied
private final int zeroToThirtyOneOccupied
-
-
Constructor Details
-
ImmutableDoubleHashSet
private ImmutableDoubleHashSet(double[] table, int occupied, int zeroToThirtyOne, int zeroToThirtyOneOccupied)
-
-
Method Details
-
checkOptimizedSize
private void checkOptimizedSize(int length) -
newSetWith
-
hashCode
public int hashCode()Description copied from interface:DoubleSetFollows the same general contract asSet.hashCode().- Specified by:
hashCodein interfaceDoubleSet- Specified by:
hashCodein classAbstractDoubleSet
-
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
-
doubleIterator
Description copied from interface:DoubleIterableReturns a primitive iterator that can be used to iterate over the DoubleIterable in an imperative style.- Specified by:
doubleIteratorin interfaceDoubleIterable
-
toArray
public double[] toArray()Description copied from interface:DoubleIterableConverts the DoubleIterable to a primitive double array.- Specified by:
toArrayin interfaceDoubleIterable
-
toArray
public double[] toArray(double[] array) Description copied from interface:DoubleIterableConverts the DoubleIterable to a primitive double 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 interfaceDoubleIterable
-
contains
public boolean contains(double value) Description copied from interface:DoubleIterableReturns true if the value is contained in the DoubleIterable, and false if it is not.- Specified by:
containsin interfaceDoubleIterable
-
each
Description copied from interface:DoubleIterableA synonym for forEach.- Specified by:
eachin interfaceDoubleIterable
-
select
Description copied from interface:DoubleIterableReturns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.- Specified by:
selectin interfaceDoubleIterable- Specified by:
selectin interfaceDoubleSet- Specified by:
selectin interfaceImmutableDoubleCollection- Specified by:
selectin interfaceImmutableDoubleSet
-
reject
Description copied from interface:DoubleIterableReturns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.- Specified by:
rejectin interfaceDoubleIterable- Specified by:
rejectin interfaceDoubleSet- Specified by:
rejectin interfaceImmutableDoubleCollection- Specified by:
rejectin interfaceImmutableDoubleSet
-
collect
Description copied from interface:DoubleIterableReturns 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 interfaceDoubleIterable- Specified by:
collectin interfaceDoubleSet- Specified by:
collectin interfaceImmutableDoubleCollection- Specified by:
collectin interfaceImmutableDoubleSet
-
detectIfNone
- Specified by:
detectIfNonein interfaceDoubleIterable
-
count
Description copied from interface:DoubleIterableReturns a count of the number of elements in the DoubleIterable that return true for the specified predicate.- Specified by:
countin interfaceDoubleIterable
-
anySatisfy
Description copied from interface:DoubleIterableReturns true if any of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfyin interfaceDoubleIterable
-
allSatisfy
Description copied from interface:DoubleIterableReturns true if all of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfyin interfaceDoubleIterable
-
noneSatisfy
Description copied from interface:DoubleIterableReturns true if none of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfyin interfaceDoubleIterable
-
sum
public double sum()- Specified by:
sumin interfaceDoubleIterable
-
max
public double max()- Specified by:
maxin interfaceDoubleIterable
-
min
public double min()- Specified by:
minin interfaceDoubleIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoin interfaceDoubleIterable
-
writeReplace
-
probe
int probe(double element) -
probeTwo
int probeTwo(double element, int removedIndex) -
probeThree
int probeThree(double element, int removedIndex) -
spreadAndMask
int spreadAndMask(double element) -
spreadTwoAndMask
int spreadTwoAndMask(double element) -
mask
private int mask(int spread)
-