org.basex.query.xpath.expr
Class Equality

java.lang.Object
  extended by org.basex.query.xpath.expr.Expr
      extended by org.basex.query.xpath.expr.DualExpr
          extended by org.basex.query.xpath.expr.Comparison
              extended by org.basex.query.xpath.expr.Equality

public final class Equality
extends Comparison

Equality Expression Able to express equality or inequality.

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

Field Summary
 
Fields inherited from class org.basex.query.xpath.expr.Comparison
type
 
Fields inherited from class org.basex.query.xpath.expr.DualExpr
expr1, expr2
 
Constructor Summary
Equality(Expr e1, Expr e2, Comp t)
          Constructor.
 
Method Summary
 Expr compile(XPContext ctx)
          Tries to optimize the Expression.
 Path indexEquivalent(XPContext ctx, Step curr)
          For predicate optimization.
 int indexSizes(XPContext ctx, Step curr, int min)
          For predicate optimization.
 
Methods inherited from class org.basex.query.xpath.expr.Comparison
eval, simple, toString
 
Methods inherited from class org.basex.query.xpath.expr.DualExpr
usesPos, usesSize
 
Methods inherited from class org.basex.query.xpath.expr.Expr
returnedValue, sameAs
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Equality

public Equality(Expr e1,
                Expr e2,
                Comp t)
Constructor.

Parameters:
e1 - first expression
e2 - second expression to compare with first
t - EqualityExpr.EQUALS or EqualityExpr.NOT_EQUALS
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

indexEquivalent

public Path indexEquivalent(XPContext ctx,
                            Step curr)
Description copied from class: Expr
For predicate optimization. If possible return an expression yielding the same results using the index. This may not do any changes to the current expression.

Overrides:
indexEquivalent in class Expr
Parameters:
ctx - root
curr - the LocationStep this Expression is a predicate of
Returns:
Equivalent index-expression or null

indexSizes

public int indexSizes(XPContext ctx,
                      Step curr,
                      int min)
Description copied from class: Expr
For predicate optimization. If possible return the number of entries an index returns. This may not do any changes to the current expression.

Overrides:
indexSizes in class Expr
Parameters:
ctx - root
curr - the LocationStep this Expression is a predicate of
min - current minimum size
Returns:
Equivalent index-expression or null