ValidatedExpression

constructor()

A validated math expression with default equation of "0"

This constructor is primarily intended for validation in other ValidatedFields (such as lists or maps)

This ValidatedField is itself an expression, so you can call eval() or evalSafe() on it directly.

Author

fzzyhmstrs

Since

0.2.0


constructor(defaultValue: String, validVars: Set<Char> = setOf(), validator: EntryValidator<String> = object: EntryValidator<String> { override fun validateEntry(input: String, type: EntryValidator.ValidationType): ValidationResult<String> { return Expression.tryTest(input, validVars).wrap(input) } override fun toString(): String { return "Dummy test with valid variable chars" } })

Parameters

defaultValue

String - representation of the desired math expression, parsed to a cached Expression internally.

validVars

Set - represents the valid variable characters the user can utilize in their expression.

validator

EntryValidator, optional - validates entered math strings