Class LongHashSet.ImmutableLongHashSet
java.lang.Object
org.eclipse.collections.impl.primitive.AbstractLongIterable
org.eclipse.collections.impl.set.primitive.AbstractLongSet
org.eclipse.collections.impl.set.immutable.primitive.AbstractImmutableLongSet
org.eclipse.collections.impl.set.mutable.primitive.LongHashSet.ImmutableLongHashSet
- All Implemented Interfaces:
Serializable
,ImmutableLongCollection
,LongIterable
,PrimitiveIterable
,ImmutableLongSet
,LongSet
- Enclosing class:
LongHashSet
private static final class LongHashSet.ImmutableLongHashSet
extends AbstractImmutableLongSet
implements Serializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private static final long
private final long[]
private final int
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ImmutableLongHashSet
(long[] table, int occupied, int zeroToThirtyOne, int zeroToThirtyOneOccupied) -
Method Summary
Modifier and TypeMethodDescriptionboolean
allSatisfy
(LongPredicate predicate) Returns true if all of the elements in the LongIterable return true for the specified predicate, otherwise returns false.boolean
anySatisfy
(LongPredicate predicate) Returns true if any of the elements in the LongIterable 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
(LongToObjectFunction<? extends V> function) Returns a new collection with the results of applying the specified function on each element of the source collection.boolean
contains
(long value) Returns true if the value is contained in the LongIterable, and false if it is not.int
count
(LongPredicate predicate) Returns a count of the number of elements in the LongIterable that return true for the specified predicate.long
detectIfNone
(LongPredicate predicate, long ifNone) void
each
(LongProcedure procedure) A synonym for forEach.int
hashCode()
Follows the same general contract asSet.hashCode()
.<T> T
injectInto
(T injectedValue, ObjectLongToObjectFunction<? super T, ? extends T> function) Returns a primitive iterator that can be used to iterate over the LongIterable in an imperative style.private int
mask
(int spread) long
max()
long
min()
static ImmutableLongSet
newSetWith
(long... elements) boolean
noneSatisfy
(LongPredicate predicate) Returns true if none of the elements in the LongIterable return true for the specified predicate, otherwise returns false.(package private) int
probe
(long element) (package private) int
probeThree
(long element, int removedIndex) (package private) int
probeTwo
(long element, int removedIndex) reject
(LongPredicate predicate) Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.select
(LongPredicate predicate) Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.int
size()
Returns the number of items in this iterable.(package private) int
spreadAndMask
(long element) (package private) int
spreadTwoAndMask
(long element) long
sum()
long[]
toArray()
Converts the LongIterable to a primitive long array.long[]
toArray
(long[] array) Converts the LongIterable to a primitive long array.private Object
Methods inherited from class org.eclipse.collections.impl.set.immutable.primitive.AbstractImmutableLongSet
chunk, freeze, newWith, newWithAll, newWithout, newWithoutAll, toImmutable
Methods inherited from class org.eclipse.collections.impl.set.primitive.AbstractLongSet
cartesianProduct, equals
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractLongIterable
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.set.primitive.ImmutableLongSet
difference, intersect, symmetricDifference, tap, union
Methods inherited from interface org.eclipse.collections.api.LongIterable
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.LongSet
cartesianProduct, equals, isProperSubsetOf, isSubsetOf, tap
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 long[] table -
occupied
private final int occupied -
zeroToThirtyOne
private final int zeroToThirtyOne -
zeroToThirtyOneOccupied
private final int zeroToThirtyOneOccupied
-
-
Constructor Details
-
ImmutableLongHashSet
private ImmutableLongHashSet(long[] table, int occupied, int zeroToThirtyOne, int zeroToThirtyOneOccupied)
-
-
Method Details
-
checkOptimizedSize
private void checkOptimizedSize(int length) -
newSetWith
-
hashCode
public int hashCode()Description copied from interface:LongSet
Follows the same general contract asSet.hashCode()
.- Specified by:
hashCode
in interfaceLongSet
- Specified by:
hashCode
in classAbstractLongSet
-
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
-
longIterator
Description copied from interface:LongIterable
Returns a primitive iterator that can be used to iterate over the LongIterable in an imperative style.- Specified by:
longIterator
in interfaceLongIterable
-
toArray
public long[] toArray()Description copied from interface:LongIterable
Converts the LongIterable to a primitive long array.- Specified by:
toArray
in interfaceLongIterable
-
toArray
public long[] toArray(long[] array) Description copied from interface:LongIterable
Converts the LongIterable to a primitive long 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 interfaceLongIterable
-
contains
public boolean contains(long value) Description copied from interface:LongIterable
Returns true if the value is contained in the LongIterable, and false if it is not.- Specified by:
contains
in interfaceLongIterable
-
each
Description copied from interface:LongIterable
A synonym for forEach.- Specified by:
each
in interfaceLongIterable
-
select
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.- Specified by:
select
in interfaceImmutableLongCollection
- Specified by:
select
in interfaceImmutableLongSet
- Specified by:
select
in interfaceLongIterable
- Specified by:
select
in interfaceLongSet
-
reject
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.- Specified by:
reject
in interfaceImmutableLongCollection
- Specified by:
reject
in interfaceImmutableLongSet
- Specified by:
reject
in interfaceLongIterable
- Specified by:
reject
in interfaceLongSet
-
collect
Description copied from interface:LongIterable
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 interfaceImmutableLongCollection
- Specified by:
collect
in interfaceImmutableLongSet
- Specified by:
collect
in interfaceLongIterable
- Specified by:
collect
in interfaceLongSet
-
detectIfNone
- Specified by:
detectIfNone
in interfaceLongIterable
-
count
Description copied from interface:LongIterable
Returns a count of the number of elements in the LongIterable that return true for the specified predicate.- Specified by:
count
in interfaceLongIterable
-
anySatisfy
Description copied from interface:LongIterable
Returns true if any of the elements in the LongIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfy
in interfaceLongIterable
-
allSatisfy
Description copied from interface:LongIterable
Returns true if all of the elements in the LongIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfy
in interfaceLongIterable
-
noneSatisfy
Description copied from interface:LongIterable
Returns true if none of the elements in the LongIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfy
in interfaceLongIterable
-
sum
public long sum()- Specified by:
sum
in interfaceLongIterable
-
max
public long max()- Specified by:
max
in interfaceLongIterable
-
min
public long min()- Specified by:
min
in interfaceLongIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectLongToObjectFunction<? super T, ? extends T> function) - Specified by:
injectInto
in interfaceLongIterable
-
writeReplace
-
probe
int probe(long element) -
probeTwo
int probeTwo(long element, int removedIndex) -
probeThree
int probeThree(long element, int removedIndex) -
spreadAndMask
int spreadAndMask(long element) -
spreadTwoAndMask
int spreadTwoAndMask(long element) -
mask
private int mask(int spread)
-