com.mckoi.database
Class QueryPlan.FetchViewNode

java.lang.Object
  extended by com.mckoi.database.QueryPlan.FetchViewNode
All Implemented Interfaces:
QueryPlanNode, java.io.Serializable, java.lang.Cloneable
Enclosing class:
QueryPlan

public static class QueryPlan.FetchViewNode
extends java.lang.Object
implements QueryPlanNode

The node that fetches a view from the current connection. This is a tree node that has no children, however the child can be created by calling the 'createViewChildNode' method. This node can be removed from a plan tree by calling the 'createViewChildNode' method and substituting this node with the returned child. For a planner that normalizes and optimizes plan trees, this is a useful feature.

See Also:
Serialized Form

Constructor Summary
QueryPlan.FetchViewNode(TableName table_name, TableName aliased_as)
           
 
Method Summary
 java.lang.Object clone()
          Deep clones this query plan.
 QueryPlanNode createViewChildNode(QueryContext context)
          Returns the QueryPlanNode that resolves to the view.
 void debugString(int level, java.lang.StringBuffer buf)
          Writes a textural representation of the node to the StringBuffer at the given indent level.
 java.util.ArrayList discoverCorrelatedVariables(int level, java.util.ArrayList list)
          Discovers all the correlated variables in the plan (and plan children) that reference a particular layer.
 java.util.ArrayList discoverTableNames(java.util.ArrayList list)
          Adds the table name to the list if it's not already in there.
 Table evaluate(QueryContext context)
          Evaluates the node and returns the result as a Table.
 java.lang.String titleString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryPlan.FetchViewNode

public QueryPlan.FetchViewNode(TableName table_name,
                               TableName aliased_as)
Method Detail

createViewChildNode

public QueryPlanNode createViewChildNode(QueryContext context)
Returns the QueryPlanNode that resolves to the view. This looks up the query plan in the context given.


discoverTableNames

public java.util.ArrayList discoverTableNames(java.util.ArrayList list)
Adds the table name to the list if it's not already in there.

Specified by:
discoverTableNames in interface QueryPlanNode

evaluate

public Table evaluate(QueryContext context)
Description copied from interface: QueryPlanNode
Evaluates the node and returns the result as a Table. The VariableResolver resolves any outer variables

Specified by:
evaluate in interface QueryPlanNode

discoverCorrelatedVariables

public java.util.ArrayList discoverCorrelatedVariables(int level,
                                                       java.util.ArrayList list)
Description copied from interface: QueryPlanNode
Discovers all the correlated variables in the plan (and plan children) that reference a particular layer. For example, if we wanted to find all the CorrelatedVariable objects that reference the current layer, we would typically call 'discoverCorrelatedVariables(0, new ArrayList())'

Specified by:
discoverCorrelatedVariables in interface QueryPlanNode

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: QueryPlanNode
Deep clones this query plan.

Specified by:
clone in interface QueryPlanNode
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

titleString

public java.lang.String titleString()

debugString

public void debugString(int level,
                        java.lang.StringBuffer buf)
Description copied from interface: QueryPlanNode
Writes a textural representation of the node to the StringBuffer at the given indent level.

Specified by:
debugString in interface QueryPlanNode