org.objectweb.medor.filter.jorm.lib
Class SinglePName

java.lang.Object
  |
  +--org.objectweb.medor.filter.lib.BasicBinaryOperator
        |
        +--org.objectweb.medor.filter.jorm.lib.SinglePName
All Implemented Interfaces:
BinaryOperator, Cloneable, java.lang.Cloneable, Expression, Operator

public class SinglePName
extends BasicBinaryOperator

A SinglePName is an Operator representing the construction of a PName from a NamingContext and a single Field.

The NamingContext is provided as a ParameterOperand. The name of the ParameterOperand is defined to be:

  1. The fully qualified class name for the PName of the class itself
  2. The fully qualified class name, to which the attribute name is concatenated for a reference PName
The Field is provided as a FieldOperand.

Author:
Alexandre Lefebvre

Field Summary
 
Fields inherited from class org.objectweb.medor.filter.lib.BasicBinaryOperator
left, leftResult, result, right, rightResult, type, verified
 
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
 
Constructor Summary
SinglePName(FieldOperand f, Operand p, PType nameType)
          Constructs a SinglePName from a ParameterOperand representing the naming context, a FieldOperand, and the PType of the corresponding PName.
 
Method Summary
 void compileExpression()
          Checks the semantic integrity of an expression.
 void evaluate(ParameterOperand[] pos, Tuple t)
          It evaluates the expression tree and puts the result into the operand result.
 FieldOperand getField()
           
 java.lang.String getOperatorString()
          There is no Java operator associated to a PName
 ParameterOperand getPNameManagerParameter()
           
 
Methods inherited from class org.objectweb.medor.filter.lib.BasicBinaryOperator
clone, getExpression, getLeftExpression, getOperandNumber, getResult, getRightExpression, getType, isCompiled, setExpression, setLeftExpression, setRightExpression
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SinglePName

public SinglePName(FieldOperand f,
                   Operand p,
                   PType nameType)
Constructs a SinglePName from a ParameterOperand representing the naming context, a FieldOperand, and the PType of the corresponding PName.

Parameters:
f - is the FieldOperand from which the value is taken.
p - is the Operand representing the naming context.
nameType - is the PType of the PName created by this operator.
Method Detail

evaluate

public 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
Specified by:
evaluate in class BasicBinaryOperator
Parameters:
pos - a list of ParameterOperand
t - Tuple
Throws:
MedorException - if evaluation error

compileExpression

public void compileExpression()
                       throws TypingException,
                              MalformedExpressionException
Checks the semantic integrity of an expression. It checks that all types are compatible and prepare the expression to be evaluable. It also creates buffers where stores the result. Notes that when evaluating there is no creation of new objects. This method changes the state of this expression object, it will be evaluable and not modifiable.

Throws:
TypingException - when incompatible types error occures.
MalformedExpressionException - if syntax error

getField

public FieldOperand getField()

getPNameManagerParameter

public ParameterOperand getPNameManagerParameter()

getOperatorString

public java.lang.String getOperatorString()
There is no Java operator associated to a PName

Returns:
the String representing the operator in Java