polyglot.util
Class Position

java.lang.Object
  extended by polyglot.util.Position
All Implemented Interfaces:
java.io.Serializable

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

This class represents a posiiton within a file.

See Also:
Serialized Form

Field Summary
static Position COMPILER_GENERATED
           
static int END_UNUSED
           
static int UNKNOWN
           
 
Constructor Summary
protected Position()
          For deserialization.
  Position(Position start, Position end)
           
  Position(java.lang.String file)
           
  Position(java.lang.String file, int line)
           
  Position(java.lang.String file, int line, int column)
           
  Position(java.lang.String file, int line, int column, int endLine, int endColumn)
           
 
Method Summary
 int column()
           
static Position compilerGenerated()
          Get a compiler generated position.
static Position compilerGenerated(int depth)
          Get a compiler generated position using the caller at the given stack depth.
 int endColumn()
           
 int endLine()
           
 java.lang.String file()
           
 int line()
           
 java.lang.String nameAndLineString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

END_UNUSED

public static final int END_UNUSED
See Also:
Constant Field Values

COMPILER_GENERATED

public static final Position COMPILER_GENERATED
Constructor Detail

Position

protected Position()
For deserialization.


Position

public Position(java.lang.String file)

Position

public Position(java.lang.String file,
                int line)

Position

public Position(java.lang.String file,
                int line,
                int column)

Position

public Position(java.lang.String file,
                int line,
                int column,
                int endLine,
                int endColumn)

Position

public Position(Position start,
                Position end)
Method Detail

compilerGenerated

public static Position compilerGenerated(int depth)
Get a compiler generated position using the caller at the given stack depth. Depth 1 is the caller. Depth 2 is the caller's caller, etc.


compilerGenerated

public static Position compilerGenerated()
Get a compiler generated position.


line

public int line()

column

public int column()

endLine

public int endLine()

endColumn

public int endColumn()

file

public java.lang.String file()

nameAndLineString

public java.lang.String nameAndLineString()

toString

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