Class Striped.CompactStriped<L>

  • Enclosing class:
    Striped<L>

    private static class Striped.CompactStriped<L>
    extends Striped.PowerOfTwoStriped<L>
    Implementation of Striped where 2^k stripes are represented as an array of the same length, eagerly initialized.
    • Field Detail

      • array

        private final java.lang.Object[] array
        Size is a power of two.
    • Constructor Detail

      • CompactStriped

        private CompactStriped​(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
      • 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>