orc.error
Class SourceLocation

java.lang.Object
  extended by orc.error.SourceLocation
All Implemented Interfaces:
java.io.Serializable

public class SourceLocation
extends java.lang.Object
implements java.io.Serializable

A source location, with file, offset, line, and column information.

Author:
quark, dkitchin
See Also:
Serialized Form

Field Summary
 java.lang.Integer column
           
 java.lang.Integer endColumn
           
 java.lang.Integer endLine
           
 java.lang.Integer endOffset
           
 java.io.File file
           
 java.lang.Integer line
           
 java.lang.Integer offset
           
static SourceLocation UNKNOWN
           
 
Constructor Summary
SourceLocation()
          No-arg constructor so that this can be serialized to XML by JAXB
SourceLocation(java.io.File filename, java.lang.Integer offset, java.lang.Integer line, java.lang.Integer column, java.lang.Integer endOffset, java.lang.Integer endLine, java.lang.Integer endColumn)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getCaret()
           
 int hashCode()
           
 boolean isUnknown()
           
 SourceLocation overlap(SourceLocation that)
          Create a new source location that overlaps both this location and the argument location.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

offset

public java.lang.Integer offset

line

public java.lang.Integer line

column

public java.lang.Integer column

endOffset

public java.lang.Integer endOffset

endLine

public java.lang.Integer endLine

endColumn

public java.lang.Integer endColumn

file

public java.io.File file

UNKNOWN

public static final SourceLocation UNKNOWN
Constructor Detail

SourceLocation

public SourceLocation()
No-arg constructor so that this can be serialized to XML by JAXB


SourceLocation

public SourceLocation(java.io.File filename,
                      java.lang.Integer offset,
                      java.lang.Integer line,
                      java.lang.Integer column,
                      java.lang.Integer endOffset,
                      java.lang.Integer endLine,
                      java.lang.Integer endColumn)
Method Detail

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

isUnknown

public boolean isUnknown()

overlap

public SourceLocation overlap(SourceLocation that)
Create a new source location that overlaps both this location and the argument location. Both locations must be in the same file; returns UNKNOWN if the filenames are not equal.


toString

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

getCaret

public java.lang.String getCaret()