org.basex.query.xpath.func
Class Position

java.lang.Object
  extended by org.basex.query.xpath.expr.Expr
      extended by org.basex.query.xpath.func.Func
          extended by org.basex.query.xpath.func.Position

public final class Position
extends Func

Constructor for position() function.

Author:
Workgroup DBIS, University of Konstanz 2005-07, ISC License, Tim Petrowsky

Field Summary
 
Fields inherited from class org.basex.query.xpath.func.Func
desc
 
Constructor Summary
Position(Expr[] arg)
          Function Constructor.
 
Method Summary
 boolean checkArguments()
          Checks validity/number of arguments.
 Num eval(XPContext ctx)
          Evaluates the expression with the specified context set.
 boolean usesPos()
          Checks whether this Expression (or its children) make use of the position parameter.
 
Methods inherited from class org.basex.query.xpath.func.Func
compile, evalArgs, toString, usesSize
 
Methods inherited from class org.basex.query.xpath.expr.Expr
indexEquivalent, indexSizes, returnedValue, sameAs
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Position

public Position(Expr[] arg)
Function Constructor.

Parameters:
arg - expression array
Method Detail

checkArguments

public boolean checkArguments()
Description copied from class: Func
Checks validity/number of arguments.

Specified by:
checkArguments in class Func
Returns:
result of comparison

eval

public Num eval(XPContext ctx)
         throws EvalException
Description copied from class: Expr
Evaluates the expression with the specified context set. Additionally provides a context

Specified by:
eval in class Expr
Parameters:
ctx - query context
Returns:
resulting XPathValue
Throws:
EvalException - evaluation exception

usesPos

public boolean usesPos()
Description copied from class: Expr
Checks whether this Expression (or its children) make use of the position parameter. If not this allows some nice optimizations.

Overrides:
usesPos in class Func
Returns:
whether position is used