edu.rice.cs.javalanglevels
Class SourceInfo

java.lang.Object
  extended by edu.rice.cs.javalanglevels.SourceInfo

public final class SourceInfo
extends java.lang.Object

A simple tuple class to represent source location for pieces of the AST.


Field Summary
static SourceInfo NO_INFO
           
static SourceInfo NONE
          A constant is code generated by javacc that belongs here!.
static SourceInfo TEST_0
           
static SourceInfo TEST_1
           
 
Constructor Summary
SourceInfo(java.io.File file, int startLine, int startColumn, int endLine, int endColumn)
          Constructs a SourceInfo, given a value for the file and the coordinates.
 
Method Summary
 boolean equals(java.lang.Object obj)
          All fields must match for these to be equal
 int getEndColumn()
           
 int getEndLine()
           
 java.io.File getFile()
           
 int getStartColumn()
           
 int getStartLine()
           
 int hashCode()
          Implementation of hashCode that is consistent with equals.
static SourceInfo make(java.lang.String qualifiedClassName)
          Build a SourceInfo corresponding to the specified class name, with -1 as the value for row, column, start, finish.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final SourceInfo NONE
A constant is code generated by javacc that belongs here!.


NO_INFO

public static final SourceInfo NO_INFO

TEST_0

public static final SourceInfo TEST_0

TEST_1

public static final SourceInfo TEST_1
Constructor Detail

SourceInfo

public SourceInfo(java.io.File file,
                  int startLine,
                  int startColumn,
                  int endLine,
                  int endColumn)
Constructs a SourceInfo, given a value for the file and the coordinates.

Method Detail

getFile

public final java.io.File getFile()
Returns:
the file

getStartLine

public final int getStartLine()
Returns:
the start line

getStartColumn

public final int getStartColumn()
Returns:
the start column

getEndLine

public final int getEndLine()
Returns:
the end line

getEndColumn

public final int getEndColumn()
Returns:
the end column

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a readable representation of the information stored in this SourceInfo

equals

public boolean equals(java.lang.Object obj)
All fields must match for these to be equal

Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Implementation of hashCode that is consistent with equals. The value of the hashCode is formed by XORing the hashcode of the class object with the hashcodes of all the fields of the object.

Overrides:
hashCode in class java.lang.Object

make

public static SourceInfo make(java.lang.String qualifiedClassName)
Build a SourceInfo corresponding to the specified class name, with -1 as the value for row, column, start, finish.