org.objectweb.medor.expression.lib
Class BasicOperator

java.lang.Object
  extended byorg.objectweb.medor.clone.lib.BasicCloneable
      extended byorg.objectweb.medor.expression.lib.BasicExpression
          extended byorg.objectweb.medor.expression.lib.BasicOperator
All Implemented Interfaces:
org.objectweb.medor.clone.api.Cloneable, java.lang.Cloneable, Expression, Operator, java.io.Serializable
Direct Known Subclasses:
BasicBinaryOperator, BasicUnaryOperator, IndexedLocate, Like, Round, Substring

public abstract class BasicOperator
extends BasicExpression
implements Operator

Author:
A. Lefebvre
See Also:
Serialized Form

Field Summary
protected  Expression[] expressions
           
protected  VariableOperand result
           
protected  boolean verified
           
 
Fields inherited from class org.objectweb.medor.expression.lib.BasicExpression
logger, type
 
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, STRING_LOWER, STRING_UPPER, SUBSTRING, SUM, UMINUS
 
Constructor Summary
BasicOperator()
           
BasicOperator(Expression[] expressions)
           
BasicOperator(org.objectweb.jorm.type.api.PType type)
           
BasicOperator(org.objectweb.jorm.type.api.PType type, Expression[] expressions)
           
 
Method Summary
protected  int checkOperands(org.objectweb.jorm.type.api.PType[][] expectedTypes)
          checks the expected type as parameter of this operator.
 java.lang.Object clone(java.lang.Object clone, java.util.Map obj2clone)
          Clone the current object.
protected  void compileOperands()
           
 Expression getExpression(int i)
           
 int getOperandNumber()
           
 void setExpression(int idx, Expression e)
           
 
Methods inherited from class org.objectweb.medor.expression.lib.BasicExpression
getType
 
Methods inherited from class org.objectweb.medor.clone.lib.BasicCloneable
clone, clone, getClone
 
Methods inherited from class java.lang.Object
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

result

protected VariableOperand result

verified

protected boolean verified

expressions

protected Expression[] expressions
Constructor Detail

BasicOperator

public BasicOperator()

BasicOperator

public BasicOperator(Expression[] expressions)

BasicOperator

public BasicOperator(org.objectweb.jorm.type.api.PType type)

BasicOperator

public BasicOperator(org.objectweb.jorm.type.api.PType type,
                     Expression[] expressions)
Method Detail

clone

public java.lang.Object clone(java.lang.Object clone,
                              java.util.Map obj2clone)
                       throws java.lang.CloneNotSupportedException
Description copied from interface: org.objectweb.medor.clone.api.Cloneable
Clone the current object.

Specified by:
clone in interface org.objectweb.medor.clone.api.Cloneable
Overrides:
clone in class BasicExpression
Throws:
java.lang.CloneNotSupportedException

checkOperands

protected int checkOperands(org.objectweb.jorm.type.api.PType[][] expectedTypes)
                     throws MalformedExpressionException
checks the expected type as parameter of this operator.

Parameters:
expectedTypes - is array of parameter tuple.
Returns:
the index of found parameter tuple corresponding to the current expression array.
Throws:
MalformedExpressionException

compileOperands

protected void compileOperands()
                        throws ExpressionException,
                               MalformedExpressionException
Throws:
ExpressionException
MalformedExpressionException

getExpression

public Expression getExpression(int i)
Specified by:
getExpression in interface Operator

setExpression

public void setExpression(int idx,
                          Expression e)
Specified by:
setExpression in interface Operator

getOperandNumber

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