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 Details

    • array

      private final Object[] array
      Size is a power of two.
  • Constructor Details

    • CompactStriped

      private CompactStriped(int stripes, Supplier<L> supplier)
  • Method Details

    • 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>