net.sourceforge.nite.search.rewriter
Class DefaultConditionDistributor
java.lang.Object
net.sourceforge.nite.search.rewriter.ConditionDistributorTemplate
net.sourceforge.nite.search.rewriter.DefaultConditionDistributor
- All Implemented Interfaces:
- ParserTreeConstants, ConditionDistributor, RewriterConstants
public class DefaultConditionDistributor
- extends ConditionDistributorTemplate
This implementation first creates skeleton subqueries without conditions, for any undeclared variables;
orders them by the summed frequencies of the variables declared in each; then distributes the remaining
conditions by placing them as early as possible in the sequence of subqueries. If it is impossible to
place a condition C in a subquery which a) declares a variable used in the condition; b) has no condition;
and c) along with its predecessors declares all the variables required by C; then two subqueries must be
collapsed into one. This is a simple way of avoiding a potential circular dependency between the
and declarations in the correct order,
- Author:
- nmayo@inf.ed.ac.uk
Constructor Summary |
DefaultConditionDistributor(java.util.List conds,
java.util.Hashtable vars)
Initialise the class with a set of minimal conditions. |
Method Summary |
void |
distributeRemainingConditions()
Distribute the conditions and variable declarations across a
new set of SimpleQueries, returning the resultant complex query. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultConditionDistributor
public DefaultConditionDistributor(java.util.List conds,
java.util.Hashtable vars)
- Initialise the class with a set of minimal conditions. These may be atomic
conditions or groupings of conditions.
- Parameters:
conds
- a List of MinimalCondition objects representing SimpleNodes which should be distributedvars
- a Hashtable mapping each variable name to a List of types
distributeRemainingConditions
public void distributeRemainingConditions()
- Distribute the conditions and variable declarations across a
new set of SimpleQueries, returning the resultant complex query.
- Parameters:
orderingScheme
- a DeclarationOrderingScheme to use in ordering subqueries