Class CharHashSet.ImmutableCharHashSet

    • Field Detail

      • table

        private final char[] table
      • occupied

        private final int occupied
      • zeroToThirtyOne

        private final int zeroToThirtyOne
      • zeroToThirtyOneOccupied

        private final int zeroToThirtyOneOccupied
    • Constructor Detail

      • ImmutableCharHashSet

        private ImmutableCharHashSet​(char[] table,
                                     int occupied,
                                     int zeroToThirtyOne,
                                     int zeroToThirtyOneOccupied)
    • Method Detail

      • checkOptimizedSize

        private void checkOptimizedSize​(int length)
      • hashCode

        public int hashCode()
        Description copied from interface: CharSet
        Follows the same general contract as Set.hashCode().
        Specified by:
        hashCode in interface CharSet
        Specified by:
        hashCode in class AbstractCharSet
      • charIterator

        public CharIterator 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 interface CharIterable
      • toArray

        public char[] toArray()
        Description copied from interface: CharIterable
        Converts the CharIterable to a primitive char array.
        Specified by:
        toArray in interface CharIterable
      • 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 interface CharIterable
      • 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 interface CharIterable
      • count

        public int count​(CharPredicate predicate)
        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 interface CharIterable
      • anySatisfy

        public boolean anySatisfy​(CharPredicate predicate)
        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 interface CharIterable
      • allSatisfy

        public boolean allSatisfy​(CharPredicate predicate)
        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 interface CharIterable
      • noneSatisfy

        public boolean noneSatisfy​(CharPredicate predicate)
        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 interface CharIterable
      • writeReplace

        private java.lang.Object 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)