Class SourceLocation


  • public final class SourceLocation
    extends Object
    Implements an object that stores a line, column, and location in a source document.
    • Constructor Detail

      • SourceLocation

        public SourceLocation​(int line,
                              int column,
                              String url)
        Creates a new instance with a given line, column number and url of the source.
        Parameters:
        line - the source line number, or -1 if not available
        column - the source column number, or -1 if not available
        url - the source location, or null if not available
    • Method Detail

      • getLineNumber

        public int getLineNumber()
        Gets the source line number.
        Returns:
        the source line number, or -1 if not available
      • getColumnNumber

        public int getColumnNumber()
        Gets the source column number.
        Returns:
        the source column number, or -1 if not available.
      • getUrl

        public String getUrl()
        Gets the url of the source location.
        Returns:
        the url, or null if not available.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object