org.basex.query.xquery.expr
Class Expr

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.xquery.expr.Expr
Direct Known Subclasses:
Arr, Context, ForLet, FTExpr, Fun, Item, Root, Single, VarCall

public abstract class Expr
extends ExprInfo

Abstract Expression.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Nested Class Summary
static class Expr.Return
          Return types, evaluated by the compiler.
static class Expr.Using
          Used types, evaluated by the compiler.
 
Constructor Summary
Expr()
           
 
Method Summary
abstract  Expr comp(XQContext ctx)
          Optimizes and compiles the expression.
 boolean e()
          Returns if this is an empty sequence.
 boolean i()
          Checks if this is an item.
abstract  Iter iter(XQContext ctx)
          Evaluates the expression and returns an iterator on the resulting items.
 Type returned()
          Indicates if an expression returns the specified type.
 boolean uses(Expr.Using use)
          Indicates if an expression uses the specified type.
 
Methods inherited from class org.basex.query.ExprInfo
color, info, name, plan, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Expr

public Expr()
Method Detail

comp

public abstract Expr comp(XQContext ctx)
                   throws XQException
Optimizes and compiles the expression.

Parameters:
ctx - query context
Returns:
optimized Expression
Throws:
XQException - evaluation exception

iter

public abstract Iter iter(XQContext ctx)
                   throws XQException
Evaluates the expression and returns an iterator on the resulting items.

Parameters:
ctx - query context
Returns:
resulting item
Throws:
XQException - evaluation exception

i

public boolean i()
Checks if this is an item.

Returns:
result of check

e

public final boolean e()
Returns if this is an empty sequence.

Returns:
result of check

uses

public boolean uses(Expr.Using use)
Indicates if an expression uses the specified type. Called by the compiler to check if expressions can be reformulated. true is returned by default.

Parameters:
use - using flag
Returns:
result of check

returned

public Type returned()
Indicates if an expression returns the specified type. Called by the compiler to check if expressions can be reformulated. null is returned by default.

Returns:
result of check