org.objectweb.medor.filter.lib
Class BasicUnaryOperator
java.lang.Object
|
+--org.objectweb.medor.filter.lib.BasicUnaryOperator
- All Implemented Interfaces:
- Cloneable, java.lang.Cloneable, Expression, Operator, UnaryOperator
- Direct Known Subclasses:
- BasicUnaryArithmeticOperator, BasicUnaryLogicalOperator, IsEmpty, IsNull, Length, Sqrt
- public abstract class BasicUnaryOperator
- extends java.lang.Object
- implements UnaryOperator
- Author:
- Sebastien Chassande-Barrioz
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 |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
type
protected PType type
result
protected VariableOperand result
subResult
protected Operand subResult
BasicUnaryOperator
public BasicUnaryOperator()
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 ParameterOperandt
- 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