org.objectweb.medor.filter.jorm.lib
Class NavigatorOperator
BasicBinaryOperator
org.objectweb.medor.filter.jorm.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).
Object | clone(Object clone, Map obj2clone)
|
Operand | compileExpression() - Checks the semantic integrity of an expression.
|
Operand | evaluate(ParameterOperand[] pos, Object o) - This operator is not evaluable, and must be transformed into JoinProject
instances during the optimization step.
|
FieldOperand | getFieldOperand() - Obtains the FieldOperand at the start of the navigation.
|
MetaObject | getMetaObject() - Returns the Jorm Meta object which describes the field that is
reached by this navigator.
|
String | getOperatorString() - Returns the String representing the operator in Java
|
ArrayList | getPath() - Constructs an ArrayList containing the elements of the corresponding
path expression, excluding the initial FieldOperand.
|
ArrayList | getPath(ArrayList theList) - Starting from an input ArrayList, adds the elements of the corresponding
path expression, excluding the initial FieldOperand.
|
boolean | isPName() - Returns 'true' if the current path designes a field which is a
reference.
|
isPName
protected boolean isPName
NavigatorOperator
public NavigatorOperator(FieldOperand fop,
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).
fop
- is the FieldOperand corresponding to the left operand.att
- is the name of the attribute to which the operator nagivates.
MedorException
- when fop does not
reference a PNameField or when no field att is reachable by the
PNameField.
NavigatorOperator
public NavigatorOperator(NavigatorOperator nop,
String att)
throws MedorException
Creates a NavigatorOperator from a previously existing NavigatorOperator
and an attribute name.
nop
- is the NavigatorOperator corresponding to the left operand.att
- is the name of the attribute to which the operator nagivates.
MedorException
- when nop does not match
a PName or when no field att is reachable by the PName.
clone
public Object clone(Object clone,
Map obj2clone)
throws CloneNotSupportedException
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.
evaluate
public Operand evaluate(ParameterOperand[] pos,
Object o)
throws ExpressionException
This operator is not evaluable, and must be transformed into JoinProject
instances during the optimization step.
getFieldOperand
public FieldOperand getFieldOperand()
Obtains the FieldOperand at the start of the navigation.
- the FieldOperand corresponding to the start of the navigation.
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 String getOperatorString()
Returns the String representing the operator in Java
- the String representing the operator in Java
getPath
public ArrayList getPath()
throws MedorException
Constructs an ArrayList containing the elements of the corresponding
path expression, excluding the initial FieldOperand.
- the path expression (excluding the initial FieldOperand), as
an arrayList.
MedorException
-
getPath
public ArrayList getPath(ArrayList theList)
throws MedorException
Starting from an input ArrayList, adds the elements of the corresponding
path expression, excluding the initial FieldOperand.
theList
- is the initial ArrayList into which to add the path
elements
- the modified ArrayList containing the added path elements
MedorException
-
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.