Class ExpressionFactory

  • All Implemented Interfaces:

    
    public final class ExpressionFactory
    
                        

    This utility class provides methods to ease the building and usage of IExpression without parsing.

    • Constructor Detail

    • 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
        Returns:

        a new expression

      • buildExpression

         static IExpression buildExpression(double n)

        Given a number, builds a numeric expression.

        Parameters:
        n - a numeric value
        Returns:

        a new expression

      • 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
        Returns:

        a new expression

      • 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
        Returns:

        a new expression

      • wrap

         static IExpression wrap(double n)

        Given a double, creates a NumTreeNode and wraps it into a ListTreeNode.

        Parameters:
        n - the node to wrap
        Returns:

        an IExpression containing the passed element in a set

      • 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
        Returns:

        an IExpression containing the passed element in a set