Class OverlapUtil.Slice
java.lang.Object
net.paulhertz.pixelaudio.granular.OverlapUtil.Slice
- Enclosing class:
- OverlapUtil
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
FieldsModifier and TypeFieldDescriptionfinal intOne past the last block-local index where the span overlaps.final booleanTrue if there is any overlap at all.final intFirst block-local index where the span overlaps, inclusive. -
Constructor Summary
ConstructorsConstructorDescriptionSlice(int startIndex, int endIndex, boolean hasOverlap) Creates a block-local overlap range. -
Method Summary
-
Field Details
-
startIndex
public final int startIndexFirst block-local index where the span overlaps, inclusive. -
endIndex
public final int endIndexOne past the last block-local index where the span overlaps. -
hasOverlap
public final boolean hasOverlapTrue 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, inclusiveendIndex- one past the last overlapping index in the blockhasOverlap- true if the range contains at least one sample
-