-
- All Implemented Interfaces:
public final class ExpressionFactoryThis utility class provides methods to ease the building and usage of IExpression without parsing.
-
-
Method Summary
Modifier and Type Method Description static IExpressionbuildComplexGroundExpression(String s)Given a single literal (either variable or constant), builds the corresponding expression. static IExpressionbuildExpression(double n)Given a number, builds a numeric expression. static IExpressionbuildExpression(HashString s)Given a single literal (either variable or constant), builds the corresponding expression. static IExpressionbuildExpression(String s)Given a single literal (either variable or constant), builds the corresponding expression. static ITreeNode<out Object>buildLiteralNode(HashString s)Given a single literal (either variable or constant), builds the corresponding ITreeNode. static IExpressionwrap(double n)Given a double, creates a NumTreeNode and wraps it into a ListTreeNode. static IExpressionwrap(HashString s)Given a HashString, creates the corresponding ITreeNode and wraps it into a ListTreeNode. static IExpressionwrap(Iterable<ITreeNode<out Object>> nodes)Wraps a collection of ITreeNode into a new List IExpression. static IExpressionwrap(ITreeNode<out Object> node)Given a node, wraps it into a ListTreeNode. -
-
Method Detail
-
buildComplexGroundExpression
static IExpression buildComplexGroundExpression(String s)
Given a single literal (either variable or constant), builds the corresponding expression.
- Parameters:
s- MUST BE A SINGLE LITERAL
-
buildExpression
static IExpression buildExpression(double n)
Given a number, builds a numeric expression.
- Parameters:
n- a numeric value
-
buildExpression
static IExpression buildExpression(HashString s)
Given a single literal (either variable or constant), builds the corresponding expression.
- Parameters:
s- MUST BE A SINGLE LITERAL
-
buildExpression
static IExpression buildExpression(String s)
Given a single literal (either variable or constant), builds the corresponding expression.
- Parameters:
s- MUST BE A SINGLE LITERAL
-
buildLiteralNode
static ITreeNode<out Object> buildLiteralNode(HashString s)
Given a single literal (either variable or constant), builds the corresponding ITreeNode.
- Parameters:
s- MUST BE A SINGLE LITERAL
-
wrap
static IExpression wrap(double n)
Given a double, creates a NumTreeNode and wraps it into a ListTreeNode.
- Parameters:
n- the node to wrap
-
wrap
static IExpression wrap(HashString s)
Given a HashString, creates the corresponding ITreeNode and wraps it into a ListTreeNode.
- Parameters:
s- the node to wrap
-
wrap
static IExpression wrap(Iterable<ITreeNode<out Object>> nodes)
Wraps a collection of ITreeNode into a new List IExpression.
- Parameters:
nodes- the nodes to wrap
-
wrap
static IExpression wrap(ITreeNode<out Object> node)
Given a node, wraps it into a ListTreeNode.
- Parameters:
node- the node to wrap
-
-
-
-