org.apache.openjpa.kernel.exps
Class CompareExpression

java.lang.Object
  extended by org.apache.openjpa.kernel.exps.Exp
      extended by org.apache.openjpa.kernel.exps.CompareExpression
All Implemented Interfaces:
Serializable, Expression
Direct Known Subclasses:
EndsWithExpression, EqualExpression, GreaterThanEqualExpression, GreaterThanExpression, LessThanEqualExpression, LessThanExpression, MatchesExpression, NotEqualExpression, StartsWithExpression

abstract class CompareExpression
extends Exp

Expression that compares two others.

Author:
Abe White

Constructor Summary
CompareExpression(Val val1, Val val2)
          Constructor.
 
Method Summary
 void acceptVisit(ExpressionVisitor visitor)
          Accept a visit from a tree visitor.
protected abstract  boolean compare(Object o1, Object o2)
          Compare the two values.
protected  boolean eval(Collection candidates, StoreContext ctx, Object[] params)
          Evaluate the expression for the given group.
protected  boolean eval(Object candidate, Object orig, StoreContext ctx, Object[] params)
          Evaluate the expression for the given context candidate and original candidate.
 
Methods inherited from class org.apache.openjpa.kernel.exps.Exp
evaluate, evaluate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompareExpression

public CompareExpression(Val val1,
                         Val val2)
Constructor. Supply values to compare.

Method Detail

eval

protected boolean eval(Object candidate,
                       Object orig,
                       StoreContext ctx,
                       Object[] params)
Description copied from class: Exp
Evaluate the expression for the given context candidate and original candidate.

Overrides:
eval in class Exp

eval

protected boolean eval(Collection candidates,
                       StoreContext ctx,
                       Object[] params)
Description copied from class: Exp
Evaluate the expression for the given group.

Overrides:
eval in class Exp

compare

protected abstract boolean compare(Object o1,
                                   Object o2)
Compare the two values.


acceptVisit

public void acceptVisit(ExpressionVisitor visitor)
Description copied from interface: Expression
Accept a visit from a tree visitor.

Specified by:
acceptVisit in interface Expression
Overrides:
acceptVisit in class Exp


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.