Class OverlapUtil.Slice

java.lang.Object
net.paulhertz.pixelaudio.granular.OverlapUtil.Slice
Enclosing class:
OverlapUtil

public static final class OverlapUtil.Slice extends Object
Block-local overlap range returned by OverlapUtil.computeBlockSlice(long, int, long, long).

When hasOverlap is true, startIndex is inclusive and endIndex is exclusive, so the overlapping samples can be processed with for (int i = startIndex; i < endIndex; i++). When hasOverlap is false, both indices are 0.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    One past the last block-local index where the span overlaps.
    final boolean
    True if there is any overlap at all.
    final int
    First block-local index where the span overlaps, inclusive.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Slice(int startIndex, int endIndex, boolean hasOverlap)
    Creates a block-local overlap range.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • startIndex

      public final int startIndex
      First block-local index where the span overlaps, inclusive.
    • endIndex

      public final int endIndex
      One past the last block-local index where the span overlaps.
    • hasOverlap

      public final boolean hasOverlap
      True if there is any overlap at all.
  • Constructor Details

    • Slice

      public Slice(int startIndex, int endIndex, boolean hasOverlap)
      Creates a block-local overlap range.
      Parameters:
      startIndex - first overlapping index in the block, inclusive
      endIndex - one past the last overlapping index in the block
      hasOverlap - true if the range contains at least one sample