com.go.tea.compiler
Class SourceInfo

java.lang.Object
  |
  +--com.go.tea.compiler.SourceInfo
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
SourceDetailedInfo

public class SourceInfo
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Provides information on where an object (like a token) appeared in the the source file.

Version:
17 , 00/12/14
Author:
Brian S O'Neill
See Also:
Serialized Form

Constructor Summary
SourceInfo(int line, int startPos, int endPos)
           
 
Method Summary
 int getDetailPosition()
           
 int getEndPosition()
           
 int getLine()
           
 int getStartPosition()
           
 SourceInfo setEndPosition(int endPos)
           
 SourceInfo setEndPosition(SourceInfo info)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SourceInfo

public SourceInfo(int line,
                  int startPos,
                  int endPos)
Method Detail

getLine

public int getLine()
Returns:
The line in the source file. The first line is one.

getStartPosition

public int getStartPosition()
Returns:
The character position in the source file where this object started. The first position of the source file is zero.

getEndPosition

public int getEndPosition()
Returns:
The character position in the source file where this object ended. The first position of the source file is zero.

getDetailPosition

public int getDetailPosition()
Returns:
A character position detailing this object. Usually is the same as the start position.

setEndPosition

public SourceInfo setEndPosition(int endPos)
Returns:
A clone of this SourceInfo, but with a different end position

setEndPosition

public SourceInfo setEndPosition(SourceInfo info)
Returns:
A clone of this SourceInfo, but with a different end position

toString

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