org.incava.text
Class LineMapping

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.incava.text.LineMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class LineMapping
extends java.util.ArrayList

Converts from 0-indexed string positions to line:column values. Lines and columns are 1-indexed, matching the Java parser.

See Also:
Serialized Form

Nested Class Summary
 class LineMapping.PositionToLocation
           
 
Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
LineMapping(java.lang.String text, int startLine, int startColumn)
           
 
Method Summary
 Location getLocation(int pos)
          Converts the string position to a line:column location.
 Location[] getLocations(int startPos, int endPos)
          Converts the string position to a line:column start and end location.
 Location[] getLocations(java.awt.Point pos)
          Converts the string position to a line:column start and end location.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
containsAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode
 

Constructor Detail

LineMapping

public LineMapping(java.lang.String text,
                   int startLine,
                   int startColumn)
Method Detail

getLocations

public Location[] getLocations(java.awt.Point pos)
Converts the string position to a line:column start and end location.


getLocations

public Location[] getLocations(int startPos,
                               int endPos)
Converts the string position to a line:column start and end location.


getLocation

public Location getLocation(int pos)
Converts the string position to a line:column location.