Class SourceInfo


  • public class SourceInfo
    extends Object
    Information about the source.
    Author:
    harald
    • Constructor Detail

      • SourceInfo

        public SourceInfo​(String fileName,
                          int lineNumber,
                          int position)
        Creates a source info.
        Parameters:
        fileName - the name
        lineNumber - the linenumber (starting at 1, 0 if unknown)
        position - the character position withing the line (starting at 1, 0 if unknown)
      • SourceInfo

        public SourceInfo​(String fileName,
                          int lineNumber)
        Creates a source info.
        Parameters:
        fileName - the name
        lineNumber - the linenumber (starting at 1)
      • SourceInfo

        public SourceInfo​(String fileName)
        Creates a source info.
        Parameters:
        fileName - the name
    • Method Detail

      • getFileName

        public String getFileName()
        Gets the filename.
        Returns:
        the filename
      • getShortFileName

        public String getShortFileName()
        Gets the filename without leading directories.
        Returns:
        the short filename
      • getLineNumber

        public int getLineNumber()
        Gets the line number.
        Returns:
        the line number starting at 1
      • getPosition

        public int getPosition()
        Gets the character position within the line.
        Returns:
        the position, starting at 1
      • add

        public SourceInfo add​(int lineOffset,
                              int positionOffset)
        Returns a source info with offsets added.
        Parameters:
        lineOffset - number of lines to add
        positionOffset - number of character positions to add
        Returns:
        the new info
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object