net.sf.saffron.opt
Class VolcanoQuery

java.lang.Object
  |
  +--net.sf.saffron.opt.VolcanoQuery

public class VolcanoQuery
extends Object

A VolcanoQuery represents a set of relational expressions which derive from the same select statement.


Field Summary
static String correlPrefix
          Prefix to the name of correlating variables.
(package private)  HashMap mapCorrelToRel
          Maps name of correlating variable (e.g.
 HashMap mapDeferredToCorrel
          Maps a from-list expression to the name of the correlating variable which references it.
private  int nextCorrel
           
private  VolcanoPlanner planner
           
 
Constructor Summary
VolcanoQuery()
           
VolcanoQuery(VolcanoPlanner planner)
           
 
Method Summary
 VolcanoCluster createCluster(Environment env, SaffronTypeFactory typeFactory)
           
 String createCorrel()
          Constructs a new name for a correlating variable.
 String createCorrelUnresolved(Object deferredLookup)
          Creates a name for a correlating variable for which no SaffronRel has been created yet.
 SaffronRel lookupCorrel(String name)
          Returns the relational expression which populates a correlating variable.
 void mapCorrel(String name, SaffronRel rel)
          Maps a correlating variable to a SaffronRel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapDeferredToCorrel

public final HashMap mapDeferredToCorrel
Maps a from-list expression to the name of the correlating variable which references it. This is for forward-references, caused when from items have correlating variables. We will later resolve to a SaffronRel.


mapCorrelToRel

final HashMap mapCorrelToRel
Maps name of correlating variable (e.g. "$cor3") to the SaffronRel which implements it.


planner

private final VolcanoPlanner planner

nextCorrel

private int nextCorrel

correlPrefix

public static final String correlPrefix
Prefix to the name of correlating variables.

See Also:
Constant Field Values
Constructor Detail

VolcanoQuery

public VolcanoQuery()

VolcanoQuery

public VolcanoQuery(VolcanoPlanner planner)
Method Detail

createCluster

public VolcanoCluster createCluster(Environment env,
                                    SaffronTypeFactory typeFactory)

createCorrel

public String createCorrel()
Constructs a new name for a correlating variable. It is unique within the whole query.


createCorrelUnresolved

public String createCorrelUnresolved(Object deferredLookup)
Creates a name for a correlating variable for which no SaffronRel has been created yet.

Parameters:
deferredLookup - contains the information required to resolve the variable later

lookupCorrel

public SaffronRel lookupCorrel(String name)
Returns the relational expression which populates a correlating variable.


mapCorrel

public void mapCorrel(String name,
                      SaffronRel rel)
Maps a correlating variable to a SaffronRel.


SourceForge.net_Logo