Class SourceInfo


  • public class SourceInfo
    extends java.lang.Object
    Information about the source.
    Author:
    harald
    • Constructor Summary

      Constructors 
      Constructor Description
      SourceInfo​(java.lang.String fileName)
      Creates a source info.
      SourceInfo​(java.lang.String fileName, int lineNumber)
      Creates a source info.
      SourceInfo​(java.lang.String fileName, int lineNumber, int position)
      Creates a source info.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SourceInfo add​(int lineOffset, int positionOffset)
      Returns a source info with offsets added.
      boolean equals​(java.lang.Object obj)  
      java.lang.String getFileName()
      Gets the filename.
      int getLineNumber()
      Gets the line number.
      int getPosition()
      Gets the character position within the line.
      java.lang.String getShortFileName()
      Gets the filename without leading directories.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SourceInfo

        public SourceInfo​(java.lang.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​(java.lang.String fileName,
                          int lineNumber)
        Creates a source info.
        Parameters:
        fileName - the name
        lineNumber - the linenumber (starting at 1)
      • SourceInfo

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

      • getFileName

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

        public java.lang.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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object