org.objectweb.medor.optim.jorm

Class JormGoUpDecodeRule

Implemented Interfaces:
RewriteRule

public class JormGoUpDecodeRule
extends BasicRule

The aim of this rule is to remove comparaisons between PNames and move up the Decode operators (i.e. SinglePName and CompositePName) at the root of the QueryTree.

This rule is applied in one shot on the tree.

The Decode operators (SinglePName and CompositePName) are produced by the JormLeafRewriter rule.

Author:
S. Chassande-Barrioz

See Also:
JormLeafRewriter

Nested Class Summary

Nested classes/interfaces inherited from class org.objectweb.medor.optim.lib.BasicRule

BasicRule.ModifiedExpression

Field Summary

Fields inherited from class org.objectweb.medor.optim.lib.BasicRule

debug, log

Constructor Summary

JormGoUpDecodeRule()

Method Summary

Map
goUpDecode(QueryNode qn, boolean isRoot)
This recursive method performs the real work of the rule.
QueryTree
rewrite(QueryTree qt, QueryNode _parent)
Rewrites a QueryTree by removing comparisons between PNames and moving up the Decode operators at the root of the QueryTree.

Methods inherited from class org.objectweb.medor.optim.lib.BasicRule

replaceUsage, rewrite

Constructor Details

JormGoUpDecodeRule

public JormGoUpDecodeRule()

Method Details

goUpDecode

public Map goUpDecode(QueryNode qn,
                      boolean isRoot)
            throws MedorException
This recursive method performs the real work of the rule.

Parameters:
qn - is the QueryNode on which the rule must be applied.
isRoot - is a boolean which indicates if the qn is the root of the QueryTree.

Returns:
a map with the following characteristics:
  • key = an old projected field of a child. The old field is a PName decode or a Propagated field.
  • value = A map of composite field name associated to the new projected fields of the child. These fields replace the PName identifier. They are the PName fields. (key=composite fname, value=field)


rewrite

public QueryTree rewrite(QueryTree qt,
                         QueryNode _parent)
            throws MedorException
Rewrites a QueryTree by removing comparisons between PNames and moving up the Decode operators at the root of the QueryTree.

It relies on the goUpDecode method to perform the real work.

Specified by:
rewrite in interface RewriteRule

Parameters:
qt - the QueryTree to be rewritten

Returns:
the rewritten QueryTree

Throws:
MedorException -