com.sun.tools.javac.util
Class JCDiagnostic.SimpleDiagnosticPosition

java.lang.Object
  extended by com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition
All Implemented Interfaces:
JCDiagnostic.DiagnosticPosition
Enclosing class:
JCDiagnostic

public static class JCDiagnostic.SimpleDiagnosticPosition
extends java.lang.Object
implements JCDiagnostic.DiagnosticPosition

A DiagnosticPosition that simply identifies a position, but no related tree node, as the location for a diagnostic. Used for scanner and parser diagnostics.


Field Summary
private  int pos
           
 
Constructor Summary
JCDiagnostic.SimpleDiagnosticPosition(int pos)
           
 
Method Summary
 int getEndPosition(java.util.Map<JCTree,java.lang.Integer> endPosTable)
          If there is a tree node, and if endPositions are available, get the end position of the tree node.
 int getPreferredPosition()
          Get the position within the file that most accurately defines the location for the diagnostic.
 int getStartPosition()
          If there is a tree node, get the start position of the tree node.
 JCTree getTree()
          Gets the tree node, if any, to which the diagnostic applies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pos

private final int pos
Constructor Detail

JCDiagnostic.SimpleDiagnosticPosition

public JCDiagnostic.SimpleDiagnosticPosition(int pos)
Method Detail

getTree

public JCTree getTree()
Description copied from interface: JCDiagnostic.DiagnosticPosition
Gets the tree node, if any, to which the diagnostic applies.

Specified by:
getTree in interface JCDiagnostic.DiagnosticPosition

getStartPosition

public int getStartPosition()
Description copied from interface: JCDiagnostic.DiagnosticPosition
If there is a tree node, get the start position of the tree node. Otherwise, just returns the same as getPreferredPosition().

Specified by:
getStartPosition in interface JCDiagnostic.DiagnosticPosition

getPreferredPosition

public int getPreferredPosition()
Description copied from interface: JCDiagnostic.DiagnosticPosition
Get the position within the file that most accurately defines the location for the diagnostic.

Specified by:
getPreferredPosition in interface JCDiagnostic.DiagnosticPosition

getEndPosition

public int getEndPosition(java.util.Map<JCTree,java.lang.Integer> endPosTable)
Description copied from interface: JCDiagnostic.DiagnosticPosition
If there is a tree node, and if endPositions are available, get the end position of the tree node. Otherwise, just returns the same as getPreferredPosition().

Specified by:
getEndPosition in interface JCDiagnostic.DiagnosticPosition