Class Striped.PowerOfTwoStriped<L>

    • Field Detail

      • mask

        final int mask
        Capacity (power of two) minus one, for fast mod evaluation
    • Constructor Detail

      • PowerOfTwoStriped

        PowerOfTwoStriped​(int stripes)
    • Method Detail

      • indexFor

        final int indexFor​(java.lang.Object key)
        Description copied from class: Striped
        Returns the index to which the given key is mapped, so that getAt(indexFor(key)) == get(key).
        Specified by:
        indexFor in class Striped<L>
      • get

        public final L get​(java.lang.Object key)
        Description copied from class: Striped
        Returns the stripe that corresponds to the passed key. It is always guaranteed that if key1.equals(key2), then get(key1) == get(key2).
        Specified by:
        get in class Striped<L>
        Parameters:
        key - an arbitrary, non-null key
        Returns:
        the stripe that the passed key corresponds to