class LogicalPlan : AbstractMultiTree<LogicalPlan>
(source)
Data-structure to represent the given user input, and physical plans.
This data-structure is used for both representing the user input, and for physical plans. It basically is a binary-tree. Meaning its children are in turn also ParseTrees.
User input will get parsed through ANTLR into a parseTree by the StaticParserRPQ.
The DynamicProgrammingPlanner will parse such a parseTree from user input, into a physical plan. These physical plans can have slightly different operators and payloads in regard to a parseTree generated from user input.
LogicalPlan(query: Query, operator: Int = 0, leaf: Edge? = null)
Create a non-root empty LogicalPlan. |
var operator: Int
An Int representing the operator. See our Companion for these constants, i.e. CONCATENATION. |
|
val operatorName: String? |
var children: MutableList<ImplementingTree> |
|
val isLeaf: Boolean |
|
var leaf: Edge? |
|
val nodeRepresentation: String |
|
val query: Query |
fun contains(operatorId: Int): Boolean
Check if the current tree contains a given operator. |
|
fun containsSubtreesThroughOperator(s1: LogicalPlan, s2: LogicalPlan, operatorId: Int): Boolean
Delegate parse-tree-containment to our MultiTreeContainment. |
|
fun getSize(): Int |
|
fun mergeAndFlatten(tree: LogicalPlan, operator: Int): LogicalPlan |
|
fun subtreesOfSize(targetSize: Int): List<LogicalPlan>
Delegate parse-tree-sizing to our LogicalPlanSubtree. |
open fun clone(): ImplementingTree
Deep clone; also clone its children recusively. |
|
open fun equals(other: Any?): Boolean |
|
fun flatten(): ImplementingTree
Delegate parse-tree-flattening to our MultiTreeFlattener. |
|
fun getChild(index: Int): ImplementingTree?
Return the child at a given index or null when not existent. |
|
fun hasChild(index: Int): Boolean
|
|
open fun hashCode(): Int |
|
fun height(): Int
Recursive function calculating the height of this tree. |
|
fun postOrderTraversal(): Sequence<ImplementingTree>
Post-order traversal. |
|
fun print(): Unit
Delegate parse-tree-printing to our MultiTreePrinter. |
|
fun setLeaf(label: String): Unit
Set the leaf by giving in a String which we'll convert to an Edge. |
|
open fun toString(): String |
const val CONCATENATION: Int |
|
const val KLEENE_STAR: Int |
|
const val LEAF: Int |
|
val OPERATORS: List<Int> |
|
const val PLUS: Int |
|
const val UNION: Int |