ISourceRegion

public interface ISourceRegion extends Serializable

Interface for representing a finite region in source code text. A region has:

  • Offset - number of characters from the beginning of the source text, with interval [0,#chars).
  • Row - row or line in the source text, with interval [0,#rows), or -1 if the row is not supported.
  • Column - column in the source text, with interval [0,#columns@row), or -1 if the column is not supported.

Both the starting and ending numbers are inclusive.

Methods

contains

boolean contains(ISourceRegion region)

Checks if this region contains given region.

Parameters:
  • region – Other region to check.
Returns:

True if this region contains given region, false otherwise.

endColumn

int endColumn()
Returns:Inclusive ending column in the source text with interval [0,#columns@row), or -1 if not supported by this source region.

endOffset

int endOffset()
Returns:Inclusive ending offset, the number of characters from the beginning of the source text with interval [0,#chars).

endRow

int endRow()
Returns:Inclusive ending row or line in the source text with interval [0,#rows), or -1 if not supported by this source region.

length

int length()
Returns:Length of the source region.

startColumn

int startColumn()
Returns:Inclusive starting column in the source text with interval [0,#columns@row), or -1 if not supported by this source region.

startOffset

int startOffset()
Returns:Inclusive starting offset, the number of characters from the beginning of the source text with interval [0,#chars).

startRow

int startRow()
Returns:Inclusive starting row or line in the source text with interval [0,#rows), or -1 if not supported by this source region.