org.apache.openjpa.kernel.exps
Class ContainsExpression

java.lang.Object
  extended by org.apache.openjpa.kernel.exps.Exp
      extended by org.apache.openjpa.kernel.exps.ContainsExpression
All Implemented Interfaces:
Serializable, Expression
Direct Known Subclasses:
ContainsKeyExpression, ContainsValueExpression

 class ContainsExpression
extends Exp

Tests that a Collection contains a value.

Author:
Abe White

Constructor Summary
ContainsExpression(Val val1, Val val2)
          Constructor.
 
Method Summary
 void acceptVisit(ExpressionVisitor visitor)
          Accept a visit from a tree visitor.
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.
protected  Collection getCollection(Object obj)
          Return the container collection for the given value.
 
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

ContainsExpression

public ContainsExpression(Val val1,
                          Val val2)
Constructor.

Parameters:
val1 - the container value
val2 - the containee to test
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

getCollection

protected Collection getCollection(Object obj)
Return the container collection for the given value.


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-2010 Apache Software Foundation. All Rights Reserved.