The Meta-Environment API

toolbus.parsercup
Class PositionInformation

java.lang.Object
  extended by toolbus.parsercup.PositionInformation

public class PositionInformation
extends java.lang.Object

Like the name implies, this class contains position information (filename + begin and end line / column).

Author:
Arnold Lankamp

Field Summary
private  int beginColumn
           
private  int beginLine
           
private  int endColumn
           
private  int endLine
           
private  java.lang.String fileName
           
private  int offset
           
 
Constructor Summary
PositionInformation(java.lang.String fileName, int offset, int beginLine, int beginColumn, int endLine, int endColumn)
          Constructor.
 
Method Summary
 int getBeginColumn()
          Returns the begin column of the position.
 int getBeginLine()
          Returns the begin line of the position.
 int getEndColumn()
          Retuns the end column of the position.
 int getEndLine()
          Retuns the end line of the position.
 java.lang.String getFileName()
          Returns the name of the file this position is in.
 int getOffset()
           
 java.lang.String toString()
          Returns the serial representation of this position in the following format: filename : beginline,begincolumn - endline,endcolumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fileName

private final java.lang.String fileName

offset

private final int offset

beginLine

private final int beginLine

beginColumn

private final int beginColumn

endLine

private final int endLine

endColumn

private final int endColumn
Constructor Detail

PositionInformation

public PositionInformation(java.lang.String fileName,
                           int offset,
                           int beginLine,
                           int beginColumn,
                           int endLine,
                           int endColumn)
Constructor.

Parameters:
fileName - The name of the file the position is in.
beginLine - The begin line.
beginColumn - The begin column.
endLine - The end line.
endColumn - The end column.
Method Detail

getOffset

public int getOffset()
Returns:
the character offset of the file this position is in

getFileName

public java.lang.String getFileName()
Returns the name of the file this position is in.

Returns:
The name of the file this position is in.

getBeginLine

public int getBeginLine()
Returns the begin line of the position.

Returns:
The begin line of the position.

getBeginColumn

public int getBeginColumn()
Returns the begin column of the position.

Returns:
The begin column of the position.

getEndLine

public int getEndLine()
Retuns the end line of the position.

Returns:
The end line of the position.

getEndColumn

public int getEndColumn()
Retuns the end column of the position.

Returns:
The end column of the position.

toString

public java.lang.String toString()
Returns the serial representation of this position in the following format: filename : beginline,begincolumn - endline,endcolumn

Overrides:
toString in class java.lang.Object

The Meta-Environment API