org.objectweb.medor.filter.lib
Class BasicBinaryOperator
java.lang.Object
|
+--org.objectweb.medor.filter.lib.BasicBinaryOperator
- All Implemented Interfaces:
- BinaryOperator, java.lang.Cloneable, Cloneable, Expression, Operator
- Direct Known Subclasses:
- BasicBelongOperator, BasicBinaryArithmeticOperator, BasicBinaryLogicalOperator, BasicComparator, Concat, FirstLocate, InCollection, NavigatorOperator, SinglePName
- public abstract class BasicBinaryOperator
- extends java.lang.Object
- implements BinaryOperator
- Author:
- Sebastien Chassande-Barrioz
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 |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
type
protected PType type
left
protected Expression left
right
protected Expression right
result
protected VariableOperand result
leftResult
protected Operand leftResult
rightResult
protected Operand rightResult
verified
protected boolean verified
BasicBinaryOperator
public BasicBinaryOperator()
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 ParameterOperandt
- Tuple
- Throws:
MedorException
- if evaluation error
setLeftExpression
public void setLeftExpression(Expression leftChild)
throws java.lang.IllegalStateException
- Description copied from interface:
BinaryOperator
- This method sets the left 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:
setLeftExpression
in interface BinaryOperator
java.lang.IllegalStateException
setRightExpression
public void setRightExpression(Expression rightChild)
throws java.lang.IllegalStateException
- Description copied from interface:
BinaryOperator
- This method sets the left 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:
setRightExpression
in interface BinaryOperator
java.lang.IllegalStateException
getLeftExpression
public Expression getLeftExpression()
- Specified by:
getLeftExpression
in interface BinaryOperator
getRightExpression
public Expression getRightExpression()
- Specified by:
getRightExpression
in interface BinaryOperator
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