com.sun.tools.javac.util
Class Position.LineTabMapImpl

java.lang.Object
  extended by com.sun.tools.javac.util.Position.LineMapImpl
      extended by com.sun.tools.javac.util.Position.LineTabMapImpl
All Implemented Interfaces:
LineMap, Position.LineMap
Enclosing class:
Position

public static class Position.LineTabMapImpl
extends Position.LineMapImpl

A LineMap that handles tab expansion correctly. The cost is an additional bit per character in the source array.


Field Summary
private  java.util.BitSet tabMap
           
 
Fields inherited from class com.sun.tools.javac.util.Position.LineMapImpl
startPosition
 
Constructor Summary
Position.LineTabMapImpl(int max)
           
 
Method Summary
 int getColumnNumber(int pos)
          Find the column for a character position.
 int getPosition(int line, int column)
          Find the position corresponding to a (line,column).
protected  void setTabPosition(int offset)
           
 
Methods inherited from class com.sun.tools.javac.util.Position.LineMapImpl
build, getColumnNumber, getLineNumber, getLineNumber, getPosition, getStartPosition, getStartPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tabMap

private java.util.BitSet tabMap
Constructor Detail

Position.LineTabMapImpl

public Position.LineTabMapImpl(int max)
Method Detail

setTabPosition

protected void setTabPosition(int offset)
Overrides:
setTabPosition in class Position.LineMapImpl

getColumnNumber

public int getColumnNumber(int pos)
Description copied from interface: Position.LineMap
Find the column for a character position. Note: this method does not handle tab expansion. If tab expansion is needed, use a LineTabMap instead.

Specified by:
getColumnNumber in interface Position.LineMap
Overrides:
getColumnNumber in class Position.LineMapImpl
Parameters:
pos - character offset of the position
Returns:
the column number at which pos occurs

getPosition

public int getPosition(int line,
                       int column)
Description copied from interface: Position.LineMap
Find the position corresponding to a (line,column).

Specified by:
getPosition in interface Position.LineMap
Overrides:
getPosition in class Position.LineMapImpl
Parameters:
line - number of line (first is 1)
column - number of character on line (first is 1)
Returns:
position of character