net.esper.client.soda
Class InExpression

java.lang.Object
  extended by net.esper.client.soda.ExpressionBase
      extended by net.esper.client.soda.InExpression
All Implemented Interfaces:
Serializable, Expression

public class InExpression
extends ExpressionBase

In-expresson checks that a value is in (or not in) a set of values, equivalent to the syntax "color in ('red', 'blue')".

See Also:
Serialized Form

Constructor Summary
InExpression(boolean isNotIn)
          Ctor - for use to create an expression tree, without child expression.
InExpression(Expression value, boolean isNotIn, Object... parameters)
          Ctor - for use to create an expression tree, without child expression.
 
Method Summary
 InExpression add(Expression expression)
          Add an expression to include in the computation.
 InExpression add(Object object)
          Add a constant to include in the computation.
 InExpression add(String propertyName)
          Add a property to include in the computation.
 boolean isNotIn()
          Returns true for the not-in expression, or false for an in-expression.
 void setNotIn(boolean notIn)
          Set to true to indicate this is a not-in expression.
 void toEQL(StringWriter writer)
          Renders the expressions and all it's child expression, in full tree depth, as a string in language syntax.
 
Methods inherited from class net.esper.client.soda.ExpressionBase
addChild, getChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InExpression

public InExpression(boolean isNotIn)
Ctor - for use to create an expression tree, without child expression.

Use add methods to add child expressions to acts upon.

Parameters:
isNotIn - true for the not-in expression, false for the in-expression

InExpression

public InExpression(Expression value,
                    boolean isNotIn,
                    Object... parameters)
Ctor - for use to create an expression tree, without child expression.

Use add methods to add child expressions to acts upon.

Parameters:
value - an expression that provides the value to search for in the set
isNotIn - true for the not-in expression, false for the in-expression
parameters - is a set of constants to match against
Method Detail

isNotIn

public boolean isNotIn()
Returns true for the not-in expression, or false for an in-expression.

Returns:
true for not-in

setNotIn

public void setNotIn(boolean notIn)
Set to true to indicate this is a not-in expression.

Parameters:
notIn - true for not-in, false for in-expression

add

public InExpression add(Object object)
Add a constant to include in the computation.

Parameters:
object - constant to add
Returns:
expression

add

public InExpression add(Expression expression)
Add an expression to include in the computation.

Parameters:
expression - to add
Returns:
expression

add

public InExpression add(String propertyName)
Add a property to include in the computation.

Parameters:
propertyName - is the name of the property
Returns:
expression

toEQL

public void toEQL(StringWriter writer)
Description copied from interface: Expression
Renders the expressions and all it's child expression, in full tree depth, as a string in language syntax.

Parameters:
writer - is the output to use

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com