org.apache.jackrabbit.core.query.lucene.join
Class OperandEvaluator

java.lang.Object
  extended by org.apache.jackrabbit.core.query.lucene.join.OperandEvaluator

public class OperandEvaluator
extends Object

Evaluator of QOM operands. This class evaluates operands in the context of a value factory, a set of bind variables and possibly a query result row.


Constructor Summary
OperandEvaluator(ValueFactory factory, Map<String,Value> variables)
          Creates an operand evaluator for the given value factory and set of bind variables.
 
Method Summary
 Value getValue(Operand operand, Row row)
          Returns the value of the given operand in the context of the given row.
 Value getValue(StaticOperand operand)
          Returns the value of the given static operand (literal or bind variable).
 Value getValue(StaticOperand operand, int type)
           
 Value[] getValues(Operand operand, Row row)
          Evaluates the given operand in the context of the given row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperandEvaluator

public OperandEvaluator(ValueFactory factory,
                        Map<String,Value> variables)
Creates an operand evaluator for the given value factory and set of bind variables.

Parameters:
factory - value factory
variables - bind variables
Method Detail

getValue

public Value getValue(StaticOperand operand,
                      int type)
               throws RepositoryException
Throws:
RepositoryException

getValue

public Value getValue(StaticOperand operand)
               throws RepositoryException
Returns the value of the given static operand (literal or bind variable).

Parameters:
operand - static operand to be evaluated
Returns:
evaluated value
Throws:
RepositoryException - if a named bind variable is not found, or if the operand type is unknown

getValue

public Value getValue(Operand operand,
                      Row row)
               throws RepositoryException
Returns the value of the given operand in the context of the given row. This is a convenience method that uses a somewhat lossy best-effort mapping to evaluate multi-valued operands to a single value. Use the getValues(Operand, Row) method for more accurate results.

Parameters:
operand - operand to be evaluated
row - query result row
Returns:
evaluated value
Throws:
RepositoryException

getValues

public Value[] getValues(Operand operand,
                         Row row)
                  throws RepositoryException
Evaluates the given operand in the context of the given row.

Parameters:
operand - operand to be evaluated
row - query result row
Returns:
values of the operand at the given row
Throws:
RepositoryException - if the operand can't be evaluated


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.