ReportNode

sealed class ReportNode(source)

A sealed hierarchy of format-agnostic AST nodes representing report content.

The tree is assembled by the DSL (ksl.utilities.io.report.dsl.ReportBuilder) and traversed by ReportVisitor implementations (renderers). Each node implements accept for double-dispatch, ensuring compile-time completeness in every renderer.

Structural nodes (recurse into children):

  • Document — root of the tree; carries the report title

  • Section — collapsible/titled group of child nodes; may be nested

Content leaf nodes (carry data, no children):

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
data class DataTable(val headers: List<String>, val rows: List<List<String>>, val caption: String? = null) : ReportNode

A general-purpose tabular node for pre-formatted string data.

Link copied to clipboard
data class Document(val title: String, val children: List<ReportNode>, val defaultOutputDir: Path? = null, val defaultPlotDir: Path? = null) : ReportNode

The root node of a report document.

Link copied to clipboard
data class Heading(val text: String, val level: Int = 1) : ReportNode

A standalone heading at the given level.

Link copied to clipboard
data object PageBreak : ReportNode

A logical page or section separator.

Link copied to clipboard
data class Paragraph(val text: String) : ReportNode

A free-form paragraph of text.

Link copied to clipboard
data class PlotNode(val plot: PlotIfc, val caption: String? = null) : ReportNode

A plot node wrapping any PlotIfc implementation.

Link copied to clipboard
data class RawText(val content: String) : ReportNode

A verbatim pre-formatted text block (analogous to <pre> in HTML).

Link copied to clipboard
data class Section(val title: String?, val children: List<ReportNode>) : ReportNode

A titled, collapsible group of child nodes. Sections may be nested to any depth; renderers are responsible for tracking depth and adjusting heading levels accordingly.

Link copied to clipboard
data class StatPropertyTable(val stat: StatisticIfc, val caption: String? = null, val confidenceLevel: Double = 0.95) : ReportNode

A vertical Property | Value property sheet for a single StatisticIfc.

Link copied to clipboard
data class StatTable(val stats: List<StatisticIfc>, val caption: String? = null, val confidenceLevel: Double = 0.95, val detail: Boolean = false) : ReportNode

A horizontal summary/comparison table for any List of StatisticIfc instances.

Link copied to clipboard
data class WeightedStatPropertyTable(val stat: WeightedStatistic, val caption: String? = null) : ReportNode

A vertical Property | Value property sheet for a single WeightedStatistic.

Link copied to clipboard
data class WeightedStatTable(val stats: List<WeightedStatistic>, val caption: String? = null) : ReportNode

A horizontal comparison table for a List of WeightedStatistic instances.

Functions

Link copied to clipboard
abstract fun accept(visitor: ReportVisitor)

Double-dispatch entry point — each node calls the appropriate visitor method.