net.sourceforge.nrl.parser.util
Class StringUtilities

java.lang.Object
  extended by net.sourceforge.nrl.parser.util.StringUtilities

public class StringUtilities
extends Object

Generic utilities to help with string processing tasks that occur with NRL.


Constructor Summary
StringUtilities()
           
 
Method Summary
static int getCharacterPosition(String document, int line, int column)
          Convert a line and column in a document to a full character offset.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtilities

public StringUtilities()
Method Detail

getCharacterPosition

public static int getCharacterPosition(String document,
                                       int line,
                                       int column)
Convert a line and column in a document to a full character offset.

Parameters:
document - the document
line - the line (1-based !)
column - the column (0-based)
Returns:
the character offset, capped at 0 or document.length()-1 to keep it in range


Copyright © 2006-2010 Christian Nentwich and others