edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration
Class OperatorEvaluator

java.lang.Object
  |
  +--edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor
        |
        +--edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.OperatorEvaluator
Direct Known Subclasses:
SQLOperatorEvaluator, XQueryOperatorEvaluator

public abstract class OperatorEvaluator
extends InheritableVisitor

Insert the type's description here.


Field Summary
protected  int heuristicType
           
protected  boolean sourceVisited
          When evaluating an Operator, it is important to make sure that a Source has been visited.
protected  BindingTable variableTable
           
 
Constructor Summary
OperatorEvaluator(BindingTable varTable)
          SQLOperatorEvaluator constructor comment.
OperatorEvaluator(int heuristic, BindingTable varTable)
          SQLOperatorEvaluator constructor comment.
 
Method Summary
protected  NavigationStep[] combineSteps(NavigationStep[] entryPoint, NavigationStep[] destination)
          Put the entryPoint and destination step arrays of a Navigate Operator into 1 bigger array to make it easier to manipulate
 java.lang.String createString(NavigationStep[] step)
          createString accepts an array of NavigationSteps and will convert these steps into one long string.
 java.lang.String createString(java.lang.String varName)
          An alternate definition for createString This definition accepts a string, it then looks up the value in the varTable and returns the representation with "." instead of "/" between steps steps into one long string.
 java.lang.Object dispatch()
          Insert the method's description here.
 java.lang.Object dispatch(java.lang.Object o1)
          Do nothing
 QueryResult evaluateOperator(XATOperator nextOperator)
           
 BindingTable getVariableTable()
          Insert the method's description here.
 boolean isSourceVisited()
          Insert the method's description here.
 void setHeuristicType(int newHeuristic)
           
 void setSourceVisited(boolean newSourceVisited)
          Insert the method's description here.
 void setVariableTable(BindingTable newVariableTable)
          Insert the method's description here.
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor
getAncestors, getMethod, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

heuristicType

protected int heuristicType

variableTable

protected BindingTable variableTable

sourceVisited

protected boolean sourceVisited
When evaluating an Operator, it is important to make sure that a Source has been visited. If it hasnt, then the operator cannot go to SQL if it has, then proceed as normal
Constructor Detail

OperatorEvaluator

public OperatorEvaluator(int heuristic,
                         BindingTable varTable)
SQLOperatorEvaluator constructor comment.

OperatorEvaluator

public OperatorEvaluator(BindingTable varTable)
SQLOperatorEvaluator constructor comment.
Method Detail

combineSteps

protected NavigationStep[] combineSteps(NavigationStep[] entryPoint,
                                        NavigationStep[] destination)
Put the entryPoint and destination step arrays of a Navigate Operator into 1 bigger array to make it easier to manipulate
Parameters:
entryPoint -  
destination -  
Returns:
NavigationStep[]

createString

public java.lang.String createString(NavigationStep[] step)
createString accepts an array of NavigationSteps and will convert these steps into one long string. If a VarStep is found, it will be replaced by the actual column name(s) as found in this.variableTable The array is formatted with "/" between steps. A "/" is added at the end of the string as well
Parameters:
step - NavigationStep from which to create a string
Returns:
String corresponding to step

createString

public java.lang.String createString(java.lang.String varName)
An alternate definition for createString This definition accepts a string, it then looks up the value in the varTable and returns the representation with "." instead of "/" between steps steps into one long string. If a variable is found, it only looks 1 level deep
Parameters:
varName - String from which to create a string
Returns:
String corresponding to step

dispatch

public java.lang.Object dispatch()
Insert the method's description here.
Overrides:
dispatch in class InheritableVisitor
Parameters:
o1 - java.lang.Object

dispatch

public java.lang.Object dispatch(java.lang.Object o1)
Do nothing
Overrides:
dispatch in class InheritableVisitor
Parameters:
o1 - java.lang.Object

evaluateOperator

public QueryResult evaluateOperator(XATOperator nextOperator)

getVariableTable

public BindingTable getVariableTable()
Insert the method's description here.
Parameters:
-  

isSourceVisited

public boolean isSourceVisited()
Insert the method's description here.
Returns:
boolean

setHeuristicType

public void setHeuristicType(int newHeuristic)
Parameters:
newVariableTable - java.util.Hashtable

setSourceVisited

public void setSourceVisited(boolean newSourceVisited)
Insert the method's description here.
Parameters:
newSourceVisited - boolean

setVariableTable

public void setVariableTable(BindingTable newVariableTable)
Insert the method's description here.
Parameters:
newVariableTable - BindingTable