|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.search.rewriter.ConditionDistributorTemplate
public abstract class ConditionDistributorTemplate
This class provides a template algorithm for the condition distribution process, implementing the features that should be common to any rewriting, while leaving as abstract the core distribution algorithm, which provides a solution to the constraint-satisfaction problem of distributing the remaining conditions.
We know that some variables and conditions must occur together, and for efficiency
should occur in particular positions in the ordered subqueries. Concrete
implementations of this class should implement
This template implementation of the ConditionDistributor works by incrementally creating
declarations for different classes of variable/condition. It creates minimal-variable
SimpleQueries using the following heuristics (note that the rules are applied only to those
variables and conditions which have not already been assigned to a subquery):
We are then left with the problem of declaring the remaining variables, distributing the remaining conditions
and ordering the resultant simple queries. This final stage is controlled by
Field Summary |
---|
Fields inherited from interface net.sourceforge.nite.search.ParserTreeConstants |
---|
JJTCONDITION, JJTLOGICAL, jjtNodeName, JJTQUERY, JJTSIMPLEQUERY |
Fields inherited from interface net.sourceforge.nite.search.rewriter.RewriterConstants |
---|
BREAK_LINE, TEST_QUERIES |
Constructor Summary | |
---|---|
ConditionDistributorTemplate(java.util.List conds,
java.util.Hashtable vars)
Initialise the class with a set of MinimalConditions and DeclarableVariables. |
Method Summary | |
---|---|
void |
createSkeletonDeclarations()
Create skeleton subqueries for any remaining undeclared variables, without appending conditions. |
NodeQuery |
distribute(DeclarationOrderingScheme orderingScheme)
Distribute the conditions and variable declarations across a new set of SimpleQueries, returning the resultant complex query. |
java.util.List |
getTypes(java.lang.String varName)
Get the types associated with a particular variable. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConditionDistributorTemplate(java.util.List conds, java.util.Hashtable vars)
conds
- a List of MinimalCondition objects representing SimpleNodes which should be distributedvars
- a Hashtable mapping each variable name to a DeclarableVariable objectMethod Detail |
---|
public final NodeQuery distribute(DeclarationOrderingScheme orderingScheme)
We may wish to add hooks to this algorithm for subclasses to provide actions between stages.
distribute
in interface ConditionDistributor
orderingScheme
- a DeclarationOrderingScheme to use in ordering subqueries
public void createSkeletonDeclarations()
public java.util.List getTypes(java.lang.String varName)
getTypes
in interface ConditionDistributor
varName
- a String naming the variable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |