public final class Transformer
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Node |
reduce(CalculatorEngine engine,
ReduceOptions options,
Node expression)
Attempts to reduce the specified expression including to a value.
|
static Node |
reduce(ReduceOptions options,
Node expression) |
static Node |
standardize(Node expression)
Replace operations in expression with standard counterparts.
|
static Node |
substitute(Node expression,
java.lang.String name,
Node term)
Substitute given term for variables with specified name in expression.
|
static Node |
substituteAllBindings(Node expression)
Substitute all bindings in given expression.
|
static Node |
substituteBinding(NodeBinding binding)
Apply given binding substitutions to underlying expression.
|
public static Node reduce(CalculatorEngine engine, ReduceOptions options, Node expression)
engine
- Calculator engine (if null
, the default engine to be used).options
- Option flags to tune the reduction strategy.expression
- Expression to be reduced.java.lang.IllegalArgumentException
- if any of the parameters is null
.public static Node reduce(ReduceOptions options, Node expression)
public static Node substitute(Node expression, java.lang.String name, Node term)
expression
- Expression in which substitution takes place.name
- Name of variables to be substituted.term
- Term to replace variables.java.lang.IllegalArgumentException
- if any of the parameters is null
.public static Node substituteBinding(NodeBinding binding)
binding
- Binding node to be substituted.java.lang.IllegalArgumentException
- if any of the parameters is null
.public static Node substituteAllBindings(Node expression)
expression
- Expression to be substituted.java.lang.IllegalArgumentException
- if any of the parameters is null
.public static Node standardize(Node expression)
expression
- Expression to be transformed.java.lang.IllegalArgumentException
- if any of the parameters is null
.