org.basex.query.xpath.internal
Class OneOf

java.lang.Object
  extended by org.basex.query.xpath.expr.Expr
      extended by org.basex.query.xpath.internal.InternalExpr
          extended by org.basex.query.xpath.internal.OneOf

public final class OneOf
extends InternalExpr

This Expression assembles a number of similar comparisons of which one has to evluate true.

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

Constructor Summary
OneOf(LocPath p, Item[] v, Comp c)
          Constructor.
 
Method Summary
 Bool eval(XPContext ctx)
          Evaluates the expression with the specified context set.
 Expr indexEquivalent(XPContext ctx, Step curr)
          For predicate optimization.
 int indexSizes(XPContext ctx, Step curr, int min)
          For predicate optimization.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.xpath.internal.InternalExpr
compile, 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

OneOf

public OneOf(LocPath p,
             Item[] v,
             Comp c)
Constructor.

Parameters:
p - location path
v - second expression to compare with first
c - comparator
Method Detail

eval

public Bool eval(XPContext ctx)
          throws EvalException
Description copied from class: Expr
Evaluates the expression with the specified context set. Additionally provides a context

Specified by:
eval in class Expr
Parameters:
ctx - query context
Returns:
resulting XPathValue
Throws:
EvalException - evaluation exception

indexEquivalent

public Expr 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

toString

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