org.eclipse.mtl.parser.cst.utils
Class FileContent

java.lang.Object
  extended by org.eclipse.mtl.parser.cst.utils.FileContent

public final class FileContent
extends java.lang.Object

Utilities to read files.


Method Summary
static int columnNumber(java.lang.StringBuffer buffer, int index)
          Returns the number of the column for the given offset.
static java.lang.StringBuffer getFileContent(java.io.File file)
          Returns the content of the file.
static int lineNumber(java.lang.StringBuffer buffer, int index)
          Returns the number of the line for the given offset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileContent

public static java.lang.StringBuffer getFileContent(java.io.File file)
Returns the content of the file.

Parameters:
file - is the file
Returns:
the content of the file

columnNumber

public static int columnNumber(java.lang.StringBuffer buffer,
                               int index)
Returns the number of the column for the given offset.

Parameters:
buffer - is the buffer
index - is the offset in the buffer
Returns:
the column

lineNumber

public static int lineNumber(java.lang.StringBuffer buffer,
                             int index)
Returns the number of the line for the given offset.

Parameters:
buffer - is the buffer
index - is the offset in the buffer
Returns:
the line

Copyright 2008 Obeo
All Rights Reserved.