Class Striped.SmallLazyStriped<L>

  • Enclosing class:
    Striped<L>

    static class Striped.SmallLazyStriped<L>
    extends Striped.PowerOfTwoStriped<L>
    Implementation of Striped where up to 2^k stripes can be represented, using an AtomicReferenceArray of size 2^k. To map a user key into a stripe, we take a k-bit slice of the user key's (smeared) hashCode(). The stripes are lazily initialized and are weakly referenced.
    • Constructor Detail

      • SmallLazyStriped

        SmallLazyStriped​(int stripes,
                         Supplier<L> supplier)
    • Method Detail

      • getAt

        public L getAt​(int index)
        Description copied from class: Striped
        Returns the stripe at the specified index. Valid indexes are 0, inclusively, to size(), exclusively.
        Specified by:
        getAt in class Striped<L>
        Parameters:
        index - the index of the stripe to return; must be in [0...size())
        Returns:
        the stripe at the specified index
      • drainQueue

        private void drainQueue()
      • size

        public int size()
        Description copied from class: Striped
        Returns the total number of stripes in this instance.
        Specified by:
        size in class Striped<L>