org.objectweb.medor.filter.lib
Class Like

java.lang.Object
  |
  +--org.objectweb.medor.filter.lib.Like
All Implemented Interfaces:
java.lang.Cloneable, Cloneable, Expression, Operator

public class Like
extends java.lang.Object
implements Operator

Author:
S.Chassande-Barrioz

Field Summary
 
Fields inherited from interface org.objectweb.medor.filter.api.Operator
ABS, AND, AVG, BITWIZE, CONCAT, CONDAND, CONDOR, COUNT, DIV, EQUAL, FIRSTLOCATE, GREATER, GREATEREQUAL, IN, INDEXEDLOCATE, LENGTH, LOWER, LOWEREQUAL, MAX, MEMBEROF, MIN, MINUS, MOD, MULT, NAV, NOT, NOTEQUAL, NOTMEMBEROF, OR, PLUS, SQRT, SUBSTRING, SUM, UMINUS
 
Constructor Summary
Like(Expression str, Expression pattern)
           
Like(Expression str, Expression pattern, boolean not)
           
Like(Expression str, Expression pattern, Expression escape)
           
Like(Expression str, Expression pattern, Expression escape, boolean not)
           
 
Method Summary
 java.lang.Object clone()
           
 void compileExpression()
          Checks the semantic integrity of an expression.
 void evaluate(ParameterOperand[] values, Tuple t)
          It evaluates the expression tree and puts the result into the operand result.
 Expression getExpression(int idx)
           
 int getOperandNumber()
           
 java.lang.String getOperatorString()
          Returns the String representing the operator in Java
 Operand getResult()
          Gets the operand in wich the result will be put in
 PType getType()
          It gets the result type of this expression
 boolean isCompiled()
          Gets wether this expression is compiled or not
 void setExpression(int idx, Expression exp)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Like

public Like(Expression str,
            Expression pattern,
            Expression escape)

Like

public Like(Expression str,
            Expression pattern,
            Expression escape,
            boolean not)

Like

public Like(Expression str,
            Expression pattern)

Like

public Like(Expression str,
            Expression pattern,
            boolean not)
Method Detail

getOperatorString

public java.lang.String getOperatorString()
Description copied from interface: Operator
Returns the String representing the operator in Java

Specified by:
getOperatorString in interface Operator
Returns:
the String representing the operator in Java

getType

public PType getType()
Description copied from interface: Expression
It gets the result type of this expression

Specified by:
getType in interface Expression
Returns:
a PType object

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Specified by:
clone in interface Cloneable
Overrides:
clone in class java.lang.Object
java.lang.CloneNotSupportedException

getOperandNumber

public int getOperandNumber()
Specified by:
getOperandNumber in interface Operator

isCompiled

public boolean isCompiled()
Description copied from interface: Expression
Gets wether this expression is compiled or not

Specified by:
isCompiled in interface Expression
Returns:
true if the expression is compiled and false if it is not

getExpression

public Expression getExpression(int idx)
                         throws java.lang.ArrayIndexOutOfBoundsException
Specified by:
getExpression in interface Operator
java.lang.ArrayIndexOutOfBoundsException

compileExpression

public void compileExpression()
                       throws TypingException,
                              MalformedExpressionException
Description copied from interface: Expression
Checks the semantic integrity of an expression. It checks that all types are compatible and prepare the expression to be evaluable.It also creates buffers where stores the result. Notes that when evaluating there is no creation of new objects. This method change the state of this expression object, it will be evaluable and not modifiable.

Specified by:
compileExpression in interface Expression
Throws:
MalformedExpressionException - if syntax error
TypingException - when incompatible types error occures.

setExpression

public void setExpression(int idx,
                          Expression exp)
                   throws java.lang.ArrayIndexOutOfBoundsException
Specified by:
setExpression in interface Operator
java.lang.ArrayIndexOutOfBoundsException

getResult

public Operand getResult()
                  throws java.lang.IllegalStateException
Description copied from interface: Expression
Gets the operand in wich the result will be put in

Specified by:
getResult in interface Expression
Returns:
an Operand Object
Throws:
java.lang.IllegalStateException - if this expression is not compiled.

evaluate

public void evaluate(ParameterOperand[] values,
                     Tuple t)
              throws MedorException,
                     java.lang.IllegalStateException
Description copied from interface: Expression
It evaluates the expression tree and puts the result into the operand result.

Specified by:
evaluate in interface Expression
Parameters:
values - a list of ParameterOperand
t - Tuple
Throws:
java.lang.IllegalStateException - if this expression is not compiled.
MedorException - if evaluation error