org.basex.util
Class InputInfo

java.lang.Object
  extended by org.basex.util.InputInfo

public final class InputInfo
extends java.lang.Object

This class contains the original query, its file reference, and line/column information.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Constructor Summary
InputInfo(InputParser parser)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 java.lang.String file()
          Returns the input reference.
 int hashCode()
           
 int[] lineCol()
          Returns an array with the line and column position of the associated expression.
static int[] lineCol(java.lang.String query, int pos)
          Calculates the column and line number of a given offset in the string.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputInfo

public InputInfo(InputParser parser)
Constructor.

Parameters:
parser - input parser, containing information on the current parsing state
Method Detail

file

public java.lang.String file()
Returns the input reference.

Returns:
input reference

lineCol

public int[] lineCol()
Returns an array with the line and column position of the associated expression.

Returns:
line and column position

lineCol

public static int[] lineCol(java.lang.String query,
                            int pos)
Calculates the column and line number of a given offset in the string.

Parameters:
query - query string
pos - query position
Returns:
two element array of line and column number

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object