KthExpression

interface KthExpression

Expressions contain all the data needed to calculate an arithmetic expression when given input variables (if any are needed).

You can calculate an expression's result with the calculateResult or calculateResultWith method.

Expressions are built using a KthContext.

Properties

Link copied to clipboard
abstract var cacheEnabled: Boolean

Whether caching is enabled or not. Default is based on the context's cache property.

Link copied to clipboard
abstract val expressionVars: Set<String>

Contains the different variables used in the expression.

Functions

Link copied to clipboard

Calculates the expression and returns its result.

Link copied to clipboard
abstract fun calculateResultWith(vararg inputVars: Pair<String, Number>): KthCalculationResult

Calculates the expression using the input variables and return its result.

Link copied to clipboard
abstract fun clearCache()

Clears the result cache of the expression.

Link copied to clipboard

Disables the cache for this expression.

Link copied to clipboard

Enables the cache for this expression.