public final class SourcePosition extends Object
| Constructor and Description |
|---|
SourcePosition(File file,
com.sun.tools.javac.tree.JCTree sourceElement,
int line,
int column)
A simple constructor with no element and a single position (start = end).
|
SourcePosition(File file,
com.sun.tools.javac.tree.JCTree sourceElement,
int startLine,
int startColumn,
int endLine,
int endColumn)
Creates a new source position from all indexes.
|
SourcePosition(File file,
com.sun.tools.javac.tree.JCTree sourceElement,
Position position)
Creates a new source position from a given position (will start and end
at the same position).
|
SourcePosition(File file,
com.sun.tools.javac.tree.JCTree sourceElement,
Position startPosition,
Position endPosition)
Creates a new source position from start and end positions.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getEndColumn()
The end column in the source file.
|
int |
getEndLine()
The end line in the source file.
|
Position |
getEndPosition()
The end position in the source file.
|
File |
getFile()
The source file.
|
com.sun.tools.javac.tree.JCTree |
getSourceElement()
The source element (can be null).
|
int |
getStartColumn()
The start column in the source file.
|
int |
getStartLine()
The start line in the source file.
|
Position |
getStartPosition()
The start position in the source file.
|
String |
toString() |
public SourcePosition(File file, com.sun.tools.javac.tree.JCTree sourceElement, int startLine, int startColumn, int endLine, int endColumn)
file - the source filesourceElement - the source element if anystartLine - the start line in the source filestartColumn - the start column in the source fileendLine - the end line in the source fileendColumn - the end columb in the source filepublic SourcePosition(File file, com.sun.tools.javac.tree.JCTree sourceElement, int line, int column)
file - the source filesourceElement - the source element if anyline - the position's linecolumn - the position's columnpublic SourcePosition(File file, com.sun.tools.javac.tree.JCTree sourceElement, Position startPosition, Position endPosition)
file - the source filesourceElement - the source element if anystartPosition - the start position in the source fileendPosition - the end position in the source filepublic SourcePosition(File file, com.sun.tools.javac.tree.JCTree sourceElement, Position position)
file - the source filesourceElement - the source element if anyposition - the position this source position with start and end atpublic final File getFile()
public final Position getStartPosition()
public final Position getEndPosition()
public final int getStartLine()
public final int getStartColumn()
public final int getEndLine()
public final int getEndColumn()
public final com.sun.tools.javac.tree.JCTree getSourceElement()