org.objectweb.medor.filter.lib
Class NavigatorOperator

java.lang.Object
  extended byBasicBinaryOperator
      extended byorg.objectweb.medor.filter.lib.NavigatorOperator

public class NavigatorOperator
extends BasicBinaryOperator

A NavigatorOperator typically represents a path expression.

Such an expression starts from a FieldOperand for which the origin field is a JormField of a PName type (ref).

Author:
Alexandre Lefebvre
See Also:
Serialized Form

Field Summary
protected  boolean isPName
           
 
Constructor Summary
NavigatorOperator(FieldOperand fop, java.lang.String att)
          Creates a NavigatorOperator from a FieldOperand and an attribute name.
NavigatorOperator(NavigatorOperator nop, java.lang.String att)
          Creates a NavigatorOperator from a previously existing NavigatorOperator and an attribute name.
 
Method Summary
 java.lang.Object clone(java.lang.Object clone, java.util.Map obj2clone)
           
 Operand compileExpression()
          Checks the semantic integrity of an expression.
 org.objectweb.medor.expression.api.Operand evaluate(ParameterOperand[] pos, java.lang.Object o)
          This operator is not evaluable, and must be transformed into JoinProject instances during the optimization step.
 MetaObject getMetaObject()
          Returns the Jorm Meta object which describes the field that is reached by this navigator.
 java.lang.String getOperatorString()
          Returns the String representing the operator in Java
 boolean isPName()
          Returns 'true' if the current path designes a field which is a reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isPName

protected boolean isPName
Constructor Detail

NavigatorOperator

public NavigatorOperator(FieldOperand fop,
                         java.lang.String att)
                  throws MedorException
Creates a NavigatorOperator from a FieldOperand and an attribute name. The origin field of this FieldOperand must be a JormField of a PName type (or a PropagatedField pointing to such a JormField).

Parameters:
fop - is the FieldOperand corresponding to the left operand.
att - is the name of the attribute to which the operator nagivates.
Throws:
MedorException - when fop does not reference a PNameField or when no field att is reachable by the PNameField.

NavigatorOperator

public NavigatorOperator(NavigatorOperator nop,
                         java.lang.String att)
                  throws MedorException
Creates a NavigatorOperator from a previously existing NavigatorOperator and an attribute name.

Parameters:
nop - is the NavigatorOperator corresponding to the left operand.
att - is the name of the attribute to which the operator nagivates.
Throws:
MedorException - when nop does not match to a PName or when no field att is reachable by the PName.
Method Detail

clone

public java.lang.Object clone(java.lang.Object clone,
                              java.util.Map obj2clone)
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

isPName

public boolean isPName()
Returns 'true' if the current path designes a field which is a reference. It returns 'false' if the current path designes a primitive field.


getMetaObject

public MetaObject getMetaObject()
Returns the Jorm Meta object which describes the field that is reached by this navigator. The jorm field is never null.


getOperatorString

public java.lang.String getOperatorString()
Returns the String representing the operator in Java

Returns:
the String representing the operator in Java

evaluate

public org.objectweb.medor.expression.api.Operand evaluate(ParameterOperand[] pos,
                                                           java.lang.Object o)
                                                    throws ExpressionException
This operator is not evaluable, and must be transformed into JoinProject instances during the optimization step.

Throws:
ExpressionException

compileExpression

public Operand compileExpression()
                          throws 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 change the state of this expression object, it will be evaluable and not modifiable.

Throws:
org.objectweb.medor.expression.api.MalformedExpressionException - if syntax error
MalformedExpressionException