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