Class IndexRange

Object
com.owenfeehan.pathpatternfinder.trim.constantsubstring.IndexRange

public class IndexRange
extends Object
A range of indices in an array.
Author:
Owen Feehan
  • Constructor Details

    • IndexRange

      public IndexRange​(int startIndex, int length)
      Create for a given starting-index and length.
      Parameters:
      startIndex - the index the range begins at.
      length - how many items are in the range.
  • Method Details

    • getStartIndex

      public int getStartIndex()
      The index the range begins at.
      Returns:
      the index
    • getLength

      public int getLength()
      How many items are in the range.
      Returns:
      the number of items in the range.
    • getEndIndexExclusive

      public int getEndIndexExclusive()
      The end index (exclusive) of the range.
      Returns:
      an index can be used as an upper-bound on the range, but doesn't itself exist as an element.