Class SourceSectionFilter.IndexRange

java.lang.Object
com.oracle.truffle.api.instrumentation.SourceSectionFilter.IndexRange
Enclosing class:
SourceSectionFilter

public static final class SourceSectionFilter.IndexRange extends Object
Represents a range between two indices within a source section filter. Instances are immutable.
Since:
0.12
See Also:
  • Method Details

    • between

      public static SourceSectionFilter.IndexRange between(int startIndex, int endIndex)
      Constructs a new index range between one a first index inclusive and a second index exclusive. Parameters must comply startIndex >= 0 and startIndex <= endIndex.
      Parameters:
      startIndex - the start index (inclusive)
      endIndex - the end index (exclusive)
      Returns:
      a new index range
      Throws:
      IllegalArgumentException - if parameter invariants are violated
      Since:
      0.12
    • byLength

      public static SourceSectionFilter.IndexRange byLength(int startIndex, int length)
      Constructs a new index range with a given first index inclusive and a given length. Parameters must comply startIndex >= 0 and length >= 0.
      Parameters:
      startIndex - the start index (inclusive)
      length - the length of the range
      Returns:
      a new index range
      Throws:
      IllegalArgumentException - if parameter invariants are violated
      Since:
      0.12
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      a human readable version of the index range
      Since:
      0.12