org.basex.query.xpath.expr
Class Path

java.lang.Object
  extended by org.basex.query.xpath.expr.Expr
      extended by org.basex.query.xpath.expr.Path

public final class Path
extends Expr

Path Expression. This Expression represents a relative location path operating on a nodeset (return value of expression).

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

Field Summary
 Expr expr
          Expression to be evaluated.
 Expr path
          Location path.
 
Constructor Summary
Path(Expr e, Expr p)
          Constructor for a relative location path.
 
Method Summary
 Expr compile(XPContext ctx)
          Tries to optimize the Expression.
 NodeSet eval(XPContext ctx)
          Evaluates the expression with the specified context set.
 java.lang.String toString()
           
 boolean usesPos()
          Checks whether this Expression (or its children) make use of the position parameter.
 boolean usesSize()
          Checks whether this Expression (or its children) make use of the setsize parameter.
 
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
 

Field Detail

expr

public Expr expr
Expression to be evaluated.


path

public Expr path
Location path.

Constructor Detail

Path

public Path(Expr e,
            Expr p)
Constructor for a relative location path.

Parameters:
e - Expression evaluating to a nodeset
p - Location Path (or maybe other Expression after optimization)
Method Detail

compile

public Expr compile(XPContext ctx)
             throws EvalException
Description copied from class: Expr
Tries to optimize the Expression.

Specified by:
compile in class Expr
Parameters:
ctx - expression context
Returns:
optimized Expression
Throws:
EvalException - evaluation exception

eval

public NodeSet 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

toString

public java.lang.String toString()
Specified by:
toString in class Expr

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.

Specified by:
usesPos in class Expr
Returns:
whether position is used

usesSize

public boolean usesSize()
Description copied from class: Expr
Checks whether this Expression (or its children) make use of the setsize parameter. If not this allows early predicate evaluation.

Specified by:
usesSize in class Expr
Returns:
whether setsize is used