org.objectweb.medor.expression.lib
Class BasicBinaryOperator

java.lang.Object
  extended byorg.objectweb.medor.expression.lib.BasicOperator
      extended byorg.objectweb.medor.expression.lib.BasicBinaryOperator
All Implemented Interfaces:
BinaryOperator, java.lang.Cloneable, Expression, Operator, java.io.Serializable
Direct Known Subclasses:
BasicBinaryArithmeticOperator, BasicBinaryLogicalOperator, BasicComparator, Concat, FirstLocate

public abstract class BasicBinaryOperator
extends BasicOperator
implements BinaryOperator

Author:
Sebastien Chassande-Barrioz
See Also:
Serialized Form

Field Summary
protected  Expression left
           
protected  Expression right
           
 
Fields inherited from class org.objectweb.medor.expression.lib.BasicOperator
expressions, result, type, verified
 
Fields inherited from interface org.objectweb.medor.expression.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
BasicBinaryOperator()
           
 
Method Summary
 Expression getExpression(int idx)
           
 Expression getLeftExpression()
           
 int getOperandNumber()
           
 Expression getRightExpression()
           
 void setExpression(int idx, Expression exp)
           
 void setLeftExpression(Expression leftChild)
          This method sets the left operand or operator to this expression object.
 void setRightExpression(Expression rightChild)
          This method sets the left operand or operator to this expression object.
 
Methods inherited from class org.objectweb.medor.expression.lib.BasicOperator
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.medor.expression.api.Operator
getOperatorString
 
Methods inherited from interface org.objectweb.medor.expression.api.Expression
compileExpression, evaluate, getType
 

Field Detail

left

protected Expression left

right

protected Expression right
Constructor Detail

BasicBinaryOperator

public BasicBinaryOperator()
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
Overrides:
getExpression in class BasicOperator
Throws:
java.lang.ArrayIndexOutOfBoundsException

setExpression

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

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
Throws:
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
Throws:
java.lang.IllegalStateException

getLeftExpression

public Expression getLeftExpression()
Specified by:
getLeftExpression in interface BinaryOperator

getRightExpression

public Expression getRightExpression()
Specified by:
getRightExpression in interface BinaryOperator