org.basex.query.xpath.locpath
Class PredSimple

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.xpath.locpath.Pred
          extended by org.basex.query.xpath.locpath.PredSimple

public final class PredSimple
extends Pred

XPath predicate.

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

Field Summary
 Expr expr
          Predicate expression.
 
Constructor Summary
PredSimple(Expr exp)
          Constructor.
 
Method Summary
 Expr indexEquivalent(XPContext ctx, Step step, boolean seq)
          Returns an equivalent expression which accesses an index structure.
 int indexSizes(XPContext ctx, Step curr, int min)
          Returns the number of results if this query is evaluated by an index.
 void plan(Serializer ser)
          Recursively sends the abstract syntax of this expression to the specified serializer.
 boolean sameAs(Pred pred)
          Compares the predicate for equality.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.xpath.locpath.Pred
color
 
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

expr

public Expr expr
Predicate expression.

Constructor Detail

PredSimple

public PredSimple(Expr exp)
Constructor.

Parameters:
exp - Expression to evaluate
Method Detail

indexEquivalent

public Expr indexEquivalent(XPContext ctx,
                            Step step,
                            boolean seq)
                     throws QueryException
Description copied from class: Pred
Returns an equivalent expression which accesses an index structure.

Parameters:
ctx - root
step - location step
seq - flag for sequential evaluation
Returns:
Equivalent index-expression or null
Throws:
QueryException - evaluation exception

indexSizes

public int indexSizes(XPContext ctx,
                      Step curr,
                      int min)
Description copied from class: Pred
Returns the number of results if this query is evaluated by an index. If Integer.MAX_VALUE is returned, no index access is possible.

Parameters:
ctx - root
curr - the current location step
min - current minimum index hits
Returns:
number of expected results

sameAs

public boolean sameAs(Pred pred)
Description copied from class: Pred
Compares the predicate for equality.

Parameters:
pred - predicate to be compared
Returns:
result of check

toString

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

plan

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

Specified by:
plan in class ExprInfo
Parameters:
ser - serializer
Throws:
java.io.IOException - exception