com.gridsystems.beanfilter
Class CompareNode

java.lang.Object
  extended by com.gridsystems.beanfilter.EvalValue
      extended by com.gridsystems.beanfilter.EvalNode
          extended by com.gridsystems.beanfilter.CompareNode
All Implemented Interfaces:
FilterParserConstants

public class CompareNode
extends EvalNode
implements FilterParserConstants

Comparison operation.

Version:
1.0
Author:
Rodrigo Ruiz, Xmas

Field Summary
 
Fields inherited from class com.gridsystems.beanfilter.EvalValue
BOOLEAN, COLLECTION, NUMBER, STRING, UNKNOWN, VOID
 
Fields inherited from interface com.gridsystems.beanfilter.FilterParserConstants
ALLITEMS, AND, ANYITEMS, COMMA, CONTAINS, DEFAULT, DOT, EOF, EQ, ESCAPES, EXPONENT, FALSE, GE, GT, IDENTIFIER, IN, LBRACKET, LE, LIKE, LPAREN, LT, MATCHES, NE, NOT, NULL, NUMBER, OR, RBRACKET, RPAREN, SELECT, SIZEOF, STRING, STRING1, STRING2, THIS, tokenImage, TRUE, WHERE
 
Constructor Summary
CompareNode(EvalValue lval, int op, EvalValue rval, java.lang.Class<?> parentClass)
          Creates a new instance.
 
Method Summary
 boolean eval(java.lang.Object src)
          Evaluates the node.
static boolean evaluateOperation(EvalValue lval, EvalValue rval, java.lang.Object lobj, int op, java.lang.Object robj)
           
 EvalValue getLeftValue()
          Gets the left value.
 int getOp()
          Gets the operation of this node.
 EvalValue getRightValue()
          Gets the right value.
 java.lang.String toString()
          
 
Methods inherited from class com.gridsystems.beanfilter.EvalNode
getClassValue, getValue
 
Methods inherited from class com.gridsystems.beanfilter.EvalValue
getCharPos, getLinePos
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompareNode

public CompareNode(EvalValue lval,
                   int op,
                   EvalValue rval,
                   java.lang.Class<?> parentClass)
            throws EvalException
Creates a new instance.

Parameters:
lval - Left operand
op - Operation
rval - Right operand
parentClass - Parent Class
Throws:
EvalException - If an error occurs
Method Detail

eval

public boolean eval(java.lang.Object src)
             throws EvalException
Evaluates the node.

Specified by:
eval in class EvalNode
Parameters:
src - Data source, for dynamic nodes
Returns:
true if src makes true the node
Throws:
EvalException - If an error occurs

evaluateOperation

public static boolean evaluateOperation(EvalValue lval,
                                        EvalValue rval,
                                        java.lang.Object lobj,
                                        int op,
                                        java.lang.Object robj)
                                 throws EvalException
Parameters:
lval - Left EvalValue.
rval - Right EvalValue.
lobj - The left operand
op - Operation
robj - The right operand
Returns:
If evaluation is passed.
Throws:
EvalException - If error

getLeftValue

public EvalValue getLeftValue()
Gets the left value.

Returns:
The left value

getRightValue

public EvalValue getRightValue()
Gets the right value.

Returns:
The right value

getOp

public int getOp()
Gets the operation of this node.

Returns:
This node operation

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.