telepath / com.github.giedomak.telepath.datamodels.plans / AbstractMultiTree

AbstractMultiTree

abstract class AbstractMultiTree<ImplementingTree : AbstractMultiTree<ImplementingTree>> : Cloneable (source)

Constructors

<init>

AbstractMultiTree(query: Query, leaf: Edge? = null)

Properties

children

var children: MutableList<ImplementingTree>

isLeaf

val isLeaf: Boolean

leaf

var leaf: Edge?

nodeRepresentation

val nodeRepresentation: String

operator

abstract var operator: Int

operatorName

abstract val operatorName: String?

query

val query: Query

Functions

clone

open fun clone(): ImplementingTree

Deep clone; also clone its children recusively.

equals

open fun equals(other: Any?): Boolean

flatten

fun flatten(): ImplementingTree

Delegate parse-tree-flattening to our MultiTreeFlattener.

getChild

fun getChild(index: Int): ImplementingTree?

Return the child at a given index or null when not existent.

hasChild

fun hasChild(index: Int): Boolean

Check if a child exists with index in our children list.

hashCode

open fun hashCode(): Int

height

fun height(): Int

Recursive function calculating the height of this tree.

postOrderTraversal

fun postOrderTraversal(): Sequence<ImplementingTree>

Post-order traversal.

print

fun print(): Unit

Delegate parse-tree-printing to our MultiTreePrinter.

setChild

fun setChild(index: Int, tree: ImplementingTree): Unit

Set a child at a given index in our children list. We'll replace or add when needed.

setLeaf

fun setLeaf(label: String): Unit

Set the leaf by giving in a String which we'll convert to an Edge.

toString

open fun toString(): String

Inheritors

LogicalPlan

class LogicalPlan : AbstractMultiTree<LogicalPlan>

Data-structure to represent the given user input, and physical plans.

PhysicalPlan

class PhysicalPlan : AbstractMultiTree<PhysicalPlan>

Representation of the physical plan.