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 p)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 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 qu, int qp)
          Calculates the column and line number of a given offset in the string.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputInfo

public InputInfo(InputParser p)
Constructor.

Parameters:
p - 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 qu,
                            int qp)
Calculates the column and line number of a given offset in the string.

Parameters:
qu - query string
qp - offset
Returns:
two element array of line and column number

equals

public boolean equals(java.lang.Object obj)
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