Class ComparisonConstraint
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.constraint.SelectorBasedConstraint
-
- org.apache.jackrabbit.core.query.lucene.constraint.ComparisonConstraint
-
- All Implemented Interfaces:
Constraint
- Direct Known Subclasses:
LikeConstraint
public class ComparisonConstraint extends SelectorBasedConstraint
ComparisonConstraintimplements a comparison constraint.
-
-
Constructor Summary
Constructors Constructor Description ComparisonConstraint(DynamicOperand operand1, Operator operator, Value operand2, SelectorImpl selector)Creates a new comparison constraint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanevaluate(Value op1)Evaluates this constraint for the given dynamic operand valueop1.booleanevaluate(ScoreNode[] row, Name[] selectorNames, EvaluationContext context)Evaluates this constraint for the given row.-
Methods inherited from class org.apache.jackrabbit.core.query.lucene.constraint.SelectorBasedConstraint
getSelector, getSelectorIndex
-
-
-
-
Constructor Detail
-
ComparisonConstraint
public ComparisonConstraint(DynamicOperand operand1, Operator operator, Value operand2, SelectorImpl selector)
Creates a new comparison constraint.- Parameters:
operand1- the dynamic operand.operator- the operator.operand2- the static operand.selector- the selector for this constraint.
-
-
Method Detail
-
evaluate
public boolean evaluate(ScoreNode[] row, Name[] selectorNames, EvaluationContext context) throws IOException
Evaluates this constraint for the given row.- Parameters:
row- the current row of score nodes.selectorNames- the selector names associated withrow.context- the evaluation context.- Returns:
trueif the row satisfies the constraint,falseotherwise.- Throws:
IOException- if an error occurs while evaluating the constraint.
-
evaluate
protected boolean evaluate(Value op1) throws RepositoryException
Evaluates this constraint for the given dynamic operand valueop1.- Parameters:
op1- the current value of the dynamic operand.- Returns:
trueif the given value satisfies the constraint.- Throws:
RepositoryException- if an error occurs while converting the values.
-
-