org.objectweb.medor.filter.lib
Class BasicUnaryOperator

java.lang.Object
  |
  +--org.objectweb.medor.filter.lib.BasicUnaryOperator
All Implemented Interfaces:
java.lang.Cloneable, Cloneable, Expression, Operator, UnaryOperator
Direct Known Subclasses:
BasicAggregateOperator, BasicUnaryArithmeticOperator, BasicUnaryLogicalOperator, IsEmpty, IsNull, Length, Sqrt

public abstract class BasicUnaryOperator
extends java.lang.Object
implements UnaryOperator

Author:
Sebastien Chassande-Barrioz

Field Summary
protected  VariableOperand result
           
protected  Operand subResult
           
protected  PType type
           
 
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
BasicUnaryOperator()
           
 
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()
           
 Expression getExpression(int idx)
           
 int getOperandNumber()
           
 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(Expression e)
           
 void setExpression(int idx, Expression exp)
           
 
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

result

protected VariableOperand result

subResult

protected Operand subResult
Constructor Detail

BasicUnaryOperator

public BasicUnaryOperator()
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,
                              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:
pos - a list of ParameterOperand
t - Tuple
Throws:
java.lang.IllegalStateException - if this expression is not compiled.
MedorException - if evaluation error

setExpression

public void setExpression(Expression e)
                   throws java.lang.IllegalStateException
Specified by:
setExpression in interface UnaryOperator
java.lang.IllegalStateException

getExpression

public Expression getExpression()
Specified by:
getExpression in interface UnaryOperator

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.

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

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