com.sun.tools.apt.mirror.util
Class SourcePositionImpl

java.lang.Object
  extended by com.sun.tools.apt.mirror.util.SourcePositionImpl
All Implemented Interfaces:
SourcePosition

public class SourcePositionImpl
extends java.lang.Object
implements SourcePosition

Implementation of SourcePosition


Field Summary
private  Position.LineMap linemap
           
private  int pos
           
private  JavaFileObject sourcefile
           
 
Constructor Summary
SourcePositionImpl(JavaFileObject sourcefile, int pos, Position.LineMap linemap)
           
 
Method Summary
 int column()
          Returns the column number of this position.
 java.io.File file()
          Returns the source file containing this position.
 int getJavacPosition()
           
 JavaFileObject getSource()
           
 int line()
          Returns the line number of this position.
 java.lang.String toString()
          Returns a string representation of this position in the form "sourcefile:line", or "sourcefile" if no line number is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sourcefile

private JavaFileObject sourcefile

pos

private int pos

linemap

private Position.LineMap linemap
Constructor Detail

SourcePositionImpl

public SourcePositionImpl(JavaFileObject sourcefile,
                          int pos,
                          Position.LineMap linemap)
Method Detail

getJavacPosition

public int getJavacPosition()

getSource

public JavaFileObject getSource()

toString

public java.lang.String toString()
Returns a string representation of this position in the form "sourcefile:line", or "sourcefile" if no line number is available.

Overrides:
toString in class java.lang.Object

file

public java.io.File file()
Returns the source file containing this position.

Specified by:
file in interface SourcePosition
Returns:
the source file containing this position; never null

line

public int line()
Returns the line number of this position. Lines are numbered starting with 1.

Specified by:
line in interface SourcePosition
Returns:
the line number of this position, or 0 if the line number is unknown or not applicable

column

public int column()
Returns the column number of this position. Columns are numbered starting with 1.

Specified by:
column in interface SourcePosition
Returns:
the column number of this position, or 0 if the column number is unknown or not applicable