org.objectweb.medor.filter.lib
Class BasicThreeArgsOperator

java.lang.Object
  |
  +--org.objectweb.medor.filter.lib.BasicThreeArgsOperator
All Implemented Interfaces:
Cloneable, java.lang.Cloneable, Expression, Operator, ThreeArgsOperator
Direct Known Subclasses:
IndexedLocate, Substring

public abstract class BasicThreeArgsOperator
extends java.lang.Object
implements ThreeArgsOperator


Field Summary
protected  Expression first
           
protected  Operand firstResult
           
protected  VariableOperand result
           
protected  Expression second
           
protected  Operand secondResult
           
protected  Expression third
           
protected  Operand thirdResult
           
protected  PType type
           
protected  boolean verified
           
 
Fields inherited from interface org.objectweb.medor.filter.api.Operator
ABS, AND, BITWIZE, CONCAT, CONDAND, CONDOR, DIV, EQUAL, FIRSTLOCATE, GREATER, GREATEREQUAL, IN, INDEXEDLOCATE, LENGTH, LOWER, LOWEREQUAL, MEMBEROF, MINUS, MULT, NAV, NOT, NOTEQUAL, NOTMEMBEROF, OR, PLUS, SQRT, SUBSTRING, UMINUS
 
Constructor Summary
protected BasicThreeArgsOperator()
           
protected BasicThreeArgsOperator(Expression first, Expression second, Expression third)
           
 
Method Summary
 java.lang.Object clone()
           
abstract  void evaluate(ParameterOperand[] pos, Tuple t)
          It evaluates the expression tree and puts the result into the operand result.
 Expression getExpression(int idx)
           
 Expression getFirstExpression()
           
 int getOperandNumber()
           
 Operand getResult()
          Gets the operand in wich the result will be put in
 Expression getSecondExpression()
           
 Expression getThirdExpression()
           
 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)
           
 void setFirstExpression(Expression firstChild)
          This method sets the first operand or operator to this expression object.
 void setSecondExpression(Expression secondChild)
          This method sets the second operand or operator to this expression object.
 void setThirdExpression(Expression thirdChild)
          This method sets the third operand or operator to this expression object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.medor.filter.api.Operator
getOperatorString
 
Methods inherited from interface org.objectweb.medor.filter.api.Expression
compileExpression
 

Field Detail

type

protected PType type

first

protected Expression first

second

protected Expression second

third

protected Expression third

result

protected VariableOperand result

firstResult

protected Operand firstResult

secondResult

protected Operand secondResult

thirdResult

protected Operand thirdResult

verified

protected boolean verified
Constructor Detail

BasicThreeArgsOperator

protected BasicThreeArgsOperator(Expression first,
                                 Expression second,
                                 Expression third)

BasicThreeArgsOperator

protected BasicThreeArgsOperator()
Method Detail

getOperandNumber

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

getExpression

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

setExpression

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

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

evaluate

public abstract void evaluate(ParameterOperand[] pos,
                              Tuple t)
                       throws MedorException
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:
pos - a list of ParameterOperand
t - Tuple
Throws:
MedorException - if evaluation error

setFirstExpression

public void setFirstExpression(Expression firstChild)
                        throws java.lang.IllegalStateException
Description copied from interface: ThreeArgsOperator
This method sets the first operand or operator to this expression object. There is no verification of types when performing this method. After evaluating, we must compile this expression.

Specified by:
setFirstExpression in interface ThreeArgsOperator
java.lang.IllegalStateException

setSecondExpression

public void setSecondExpression(Expression secondChild)
                         throws java.lang.IllegalStateException
Description copied from interface: ThreeArgsOperator
This method sets the second operand or operator to this expression object. There is no verification of types when performing this method. After evaluating, we must compile this expression.

Specified by:
setSecondExpression in interface ThreeArgsOperator
java.lang.IllegalStateException

setThirdExpression

public void setThirdExpression(Expression thirdChild)
                        throws java.lang.IllegalStateException
Description copied from interface: ThreeArgsOperator
This method sets the third operand or operator to this expression object. There is no verification of types when performing this method. After evaluating, we must compile this expression.

Specified by:
setThirdExpression in interface ThreeArgsOperator
java.lang.IllegalStateException

getFirstExpression

public Expression getFirstExpression()
Specified by:
getFirstExpression in interface ThreeArgsOperator

getSecondExpression

public Expression getSecondExpression()
Specified by:
getSecondExpression in interface ThreeArgsOperator

getThirdExpression

public Expression getThirdExpression()
Specified by:
getThirdExpression in interface ThreeArgsOperator

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

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.

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