Class Constant

    • Constructor Summary

      Constructors 
      Constructor Description
      Constant​(java.lang.String constantName, double constantValue)
      Constructor - creates constant with a given name and given value
      Constant​(java.lang.String constantName, double constantValue, java.lang.String description)
      Constructor - creates constant with a given name and given value.
      Constant​(java.lang.String constantDefinitionString, PrimitiveElement... elements)
      Constructor for function definition in natural math language, for instance providing on string "f(x,y) = sin(x) + cos(x)" is enough to define function "f" with parameters "x and y" and function body "sin(x) + cos(x)".
    • Field Detail

      • NOT_FOUND

        public static final int NOT_FOUND
        When constant could not be found
        See Also:
        Constant Field Values
      • NO_SYNTAX_ERRORS

        public static final boolean NO_SYNTAX_ERRORS
        Status of the Expression syntax
        See Also:
        Constant Field Values
      • SYNTAX_ERROR_OR_STATUS_UNKNOWN

        public static final boolean SYNTAX_ERROR_OR_STATUS_UNKNOWN
        See Also:
        Constant Field Values
    • Constructor Detail

      • Constant

        public Constant​(java.lang.String constantName,
                        double constantValue)
        Constructor - creates constant with a given name and given value
        Parameters:
        constantName - the constant name
        constantValue - the constant value
      • Constant

        public Constant​(java.lang.String constantName,
                        double constantValue,
                        java.lang.String description)
        Constructor - creates constant with a given name and given value. Additionally description is being set.
        Parameters:
        constantName - the constant name
        constantValue - the constant value
        description - the constant description
      • Constant

        public Constant​(java.lang.String constantDefinitionString,
                        PrimitiveElement... elements)
        Constructor for function definition in natural math language, for instance providing on string "f(x,y) = sin(x) + cos(x)" is enough to define function "f" with parameters "x and y" and function body "sin(x) + cos(x)".
        Parameters:
        constantDefinitionString - Constant definition in the form of one String, ie "c = 2" or "c = 2*sin(pi/3)"
        elements - Optional parameters (comma separated) such as Arguments, Constants, Functions
    • Method Detail

      • getConstantName

        public java.lang.String getConstantName()
        Gets constant name
        Returns:
        the constant name as string.
      • setConstantName

        public void setConstantName​(java.lang.String constantName)
        Sets constant name. If constant is associated with any expression then this operation will set modified flag to each related expression.
        Parameters:
        constantName - the constant name
      • setConstantValue

        public void setConstantValue​(double constantValue)
        Sets constant value
        Parameters:
        constantValue - constant value
      • getConstantValue

        public double getConstantValue()
        Gets constant value.
        Returns:
        constant value as double
      • getDescription

        public java.lang.String getDescription()
        Gets constant description.
        Returns:
        constant description as string.
      • setDescription

        public void setDescription​(java.lang.String description)
        Sets constant description.
        Parameters:
        description - the constant description
      • getErrorMessage

        public java.lang.String getErrorMessage()
        Method return error message after
        Returns:
        Error message as string.
      • getSyntaxStatus

        public boolean getSyntaxStatus()
        Gets syntax status of the expression.
        Returns:
        Constant.NO_SYNTAX_ERRORS if there are no syntax errors, Const.SYNTAX_ERROR_OR_STATUS_UNKNOWN when syntax error was found or syntax status is unknown