Class Region

java.lang.Object
org.refcodes.data.Region

public class Region extends Object
A text region has a beginning index being included by the region and an end index being excluded by the region and a resulting length.
  • Field Details

    • _beginIndex

      protected int _beginIndex
    • _endIndex

      protected int _endIndex
  • Constructor Details

    • Region

      public Region(int aBeginIndex, int aEndIndex)
      Constructs a Region instance.
      Parameters:
      aBeginIndex - The beginning index (included) of the text region.
      aEndIndex - The end index (being excluded) of the region.
  • Method Details

    • getBeginIndex

      public int getBeginIndex()
      Returns the beginning index of the region (being semantically included by the region being described).
      Returns:
      The according beginning index (included).
    • getEndIndex

      public int getEndIndex()
      Returns the end index of the region (being semantically excluded by the region being described).
      Returns:
      The according end index (excluded).
    • getLength

      public int getLength()
      Returns the length of the region as of getEndIndex() - getBeginIndex().
      Returns:
      The length of the region.