AbstractTreePrinter

abstract class AbstractTreePrinter<T : Any>(val whitespaceChar: Char = ' ')(source)

Base class for printing a tree structure of objects of type T.

Parameters

whitespaceChar

the character to use for replacing whitespaces in the node text when printing. Default is ' '.

Constructors

Link copied to clipboard
constructor(whitespaceChar: Char = ' ')

Types

Link copied to clipboard
internal enum Color(val code: Int) : Enum<AbstractTreePrinter.Color>
Link copied to clipboard

Properties

Link copied to clipboard
private var currentColorIndex: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val whitespaceChar: Char = ' '

Functions

Link copied to clipboard
private fun buildTreeString(rootNode: T, indentLevel: Int): String
Link copied to clipboard
abstract fun T.children(): Sequence<T>

Returns the children of an object of type T as a Sequence.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun T.parent(): T?

Returns the parent of an object of type T.

Link copied to clipboard
fun printTreeString(rootNode: T)

Prints the tree structure of an object of type T to the console.

Link copied to clipboard
abstract fun T.simpleClassName(): String

Returns the simple class name of an object of type T.

Link copied to clipboard
abstract fun T.text(): String

Returns the text representation of an object of type T.

Link copied to clipboard
fun treeString(rootNode: T): String

Returns the tree structure of an object of type T as a string.

Link copied to clipboard
abstract fun T.typeName(): String

Returns the type name of an object of type T.

Link copied to clipboard
Link copied to clipboard
private fun T.uniqueSimpleName(): String