Class ShortHashSet.ImmutableShortHashSet

    • Field Detail

      • table

        private final short[] table
      • occupied

        private final int occupied
      • zeroToThirtyOne

        private final int zeroToThirtyOne
      • zeroToThirtyOneOccupied

        private final int zeroToThirtyOneOccupied
    • Constructor Detail

      • ImmutableShortHashSet

        private ImmutableShortHashSet​(short[] table,
                                      int occupied,
                                      int zeroToThirtyOne,
                                      int zeroToThirtyOneOccupied)
    • Method Detail

      • checkOptimizedSize

        private void checkOptimizedSize​(int length)
      • shortIterator

        public ShortIterator shortIterator()
        Description copied from interface: ShortIterable
        Returns a primitive iterator that can be used to iterate over the ShortIterable in an imperative style.
        Specified by:
        shortIterator in interface ShortIterable
      • toArray

        public short[] toArray()
        Description copied from interface: ShortIterable
        Converts the ShortIterable to a primitive short array.
        Specified by:
        toArray in interface ShortIterable
      • toArray

        public short[] toArray​(short[] array)
        Description copied from interface: ShortIterable
        Converts the ShortIterable to a primitive short 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 ShortIterable
      • contains

        public boolean contains​(short value)
        Description copied from interface: ShortIterable
        Returns true if the value is contained in the ShortIterable, and false if it is not.
        Specified by:
        contains in interface ShortIterable
      • count

        public int count​(ShortPredicate predicate)
        Description copied from interface: ShortIterable
        Returns a count of the number of elements in the ShortIterable that return true for the specified predicate.
        Specified by:
        count in interface ShortIterable
      • anySatisfy

        public boolean anySatisfy​(ShortPredicate predicate)
        Description copied from interface: ShortIterable
        Returns true if any of the elements in the ShortIterable return true for the specified predicate, otherwise returns false.
        Specified by:
        anySatisfy in interface ShortIterable
      • allSatisfy

        public boolean allSatisfy​(ShortPredicate predicate)
        Description copied from interface: ShortIterable
        Returns true if all of the elements in the ShortIterable return true for the specified predicate, otherwise returns false.
        Specified by:
        allSatisfy in interface ShortIterable
      • noneSatisfy

        public boolean noneSatisfy​(ShortPredicate predicate)
        Description copied from interface: ShortIterable
        Returns true if none of the elements in the ShortIterable return true for the specified predicate, otherwise returns false.
        Specified by:
        noneSatisfy in interface ShortIterable
      • writeReplace

        private java.lang.Object writeReplace()
      • probe

        int probe​(short element)
      • probeTwo

        int probeTwo​(short element,
                     int removedIndex)
      • probeThree

        int probeThree​(short element,
                       int removedIndex)
      • spreadAndMask

        int spreadAndMask​(short element)
      • spreadTwoAndMask

        int spreadTwoAndMask​(short element)
      • mask

        private int mask​(int spread)