org.basex.query.path
Class Step

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.expr.Expr
          extended by org.basex.query.expr.Preds
              extended by org.basex.query.path.Step
Direct Known Subclasses:
IterStep, SimpleIterStep

public class Step
extends Preds

Location Step expression.

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
 Axis axis
          Axis.
 Test test
          Node test.
 
Fields inherited from class org.basex.query.expr.Preds
pred
 
Method Summary
 Expr comp(QueryContext ctx)
          Optimizes and compiles the expression.
static Step get(Axis a, Test t, Expr... p)
          This method creates a step instance.
 NodeIter iter(QueryContext ctx)
          Evaluates the expression and returns an iterator on the resulting items.
 void plan(Serializer ser)
          Recursively sends the abstract syntax of this expression to the specified serializer.
 Return returned(QueryContext ctx)
          Indicates the return type of an expression.
 boolean sameAs(Expr cmp)
          Checks the current and specified expression for equality.
 boolean simple(Axis ax, boolean name)
          Checks if this is a simple axis without predicates.
 String toString()
           
 
Methods inherited from class org.basex.query.expr.Preds
color, removable, remove, uses
 
Methods inherited from class org.basex.query.expr.Expr
addText, atomic, checkCtx, checkDbl, checkItr, duplicates, e, ebv, i, indexAccessible, indexEquivalent, size, test, v
 
Methods inherited from class org.basex.query.ExprInfo
info, name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

axis

public Axis axis
Axis.


test

public Test test
Node test.

Method Detail

get

public static Step get(Axis a,
                       Test t,
                       Expr... p)
This method creates a step instance.

Parameters:
a - axis
t - node test
p - predicates
Returns:
step

comp

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

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

iter

public NodeIter iter(QueryContext ctx)
              throws QueryException
Description copied from class: Expr
Evaluates the expression and returns an iterator on the resulting items. If this method is not overwritten, Expr.atomic(org.basex.query.QueryContext) must be implemented.

Overrides:
iter in class Expr
Parameters:
ctx - query context
Returns:
resulting item
Throws:
QueryException - query exception

simple

public final boolean simple(Axis ax,
                            boolean name)
Checks if this is a simple axis without predicates.

Parameters:
ax - axis to be checked
name - name/node test
Returns:
result of check

sameAs

public final boolean sameAs(Expr cmp)
Description copied from class: Expr
Checks the current and specified expression for equality.

Overrides:
sameAs in class Expr
Parameters:
cmp - expression to be compared
Returns:
result of check

returned

public final Return returned(QueryContext ctx)
Description copied from class: Expr
Indicates the return type of an expression. Called by the compiler to check if expressions can be reformulated. null is returned by default.

Overrides:
returned in class Expr
Parameters:
ctx - query context
Returns:
result of check

plan

public final void plan(Serializer ser)
                throws IOException
Description copied from class: ExprInfo
Recursively sends the abstract syntax of this expression to the specified serializer.

Overrides:
plan in class Preds
Parameters:
ser - serializer
Throws:
IOException - I/O exception

toString

public final String toString()
Overrides:
toString in class Preds