org.basex.query.expr
Class Catch

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.expr.Expr
          extended by org.basex.query.expr.Single
              extended by org.basex.query.expr.Catch

public final class Catch
extends Single

Catch clause.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.expr.Expr
Expr.Use
 
Field Summary
 
Fields inherited from class org.basex.query.expr.Single
expr
 
Constructor Summary
Catch(Expr ct, QNm[] c, Var... v)
          Constructor.
 
Method Summary
 Catch comp(QueryContext ctx)
          Optimizes and compiles the expression.
 Iter iter(QueryContext ctx, QueryException ex)
          Catch iterator.
 Expr remove(Var v)
          Removes the specified variable in a sub expression.
 String toString()
           
 boolean uses(Expr.Use u, QueryContext ctx)
          Indicates if an expression uses the specified type.
 
Methods inherited from class org.basex.query.expr.Single
plan
 
Methods inherited from class org.basex.query.expr.Expr
addText, atomic, checkCtx, checkDbl, checkItr, duplicates, e, ebv, i, indexAccessible, indexEquivalent, iter, removable, returned, sameAs, size, test, v
 
Methods inherited from class org.basex.query.ExprInfo
color, info, name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Catch

public Catch(Expr ct,
             QNm[] c,
             Var... v)
Constructor.

Parameters:
ct - catch expression
c - supported error codes
v - variables
Method Detail

comp

public Catch comp(QueryContext ctx)
           throws QueryException
Description copied from class: Expr
Optimizes and compiles the expression.

Overrides:
comp in class Single
Parameters:
ctx - query context
Returns:
optimized Expression
Throws:
QueryException - query exception

iter

public Iter iter(QueryContext ctx,
                 QueryException ex)
          throws QueryException
Catch iterator.

Parameters:
ctx - query context
ex - thrown exception
Returns:
resulting item
Throws:
QueryException - query exception

uses

public boolean uses(Expr.Use u,
                    QueryContext ctx)
Description copied from class: Expr
Indicates if an expression uses the specified type. Called by the compiler to perform certain optimizations. true is returned by default and thus assumed as "worst-case".

Overrides:
uses in class Single
Parameters:
u - use type to be checked
ctx - query context
Returns:
result of check

remove

public Expr remove(Var v)
Description copied from class: Expr
Removes the specified variable in a sub expression.

Overrides:
remove in class Single
Parameters:
v - variable to be removed
Returns:
expression with removed variable

toString

public String toString()
Specified by:
toString in class ExprInfo