Class Expression

  • All Implemented Interfaces:
    java.io.Serializable

    public class Expression
    extends PrimitiveElement
    implements java.io.Serializable
    Expression - base class for real expression definition. Examples:
    • '1+2'
    • 'sin(x)+1'
    • 'asin(3*x)^10-log(4,8)'
    • in general 'f(x1,x2,...,xn)' where x1,...,xn are real arguments

    Class provides easy way to define multivariate arithmetic expression.

    Version:
    6.1.0
    See Also:
    Argument, RecursiveArgument, Constant, Function, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.List<Argument> argumentsList
      List of arguments
      private boolean attemptToFixExpStrEnabled
      Internal indicator informing the parser whether to try to fix the expression String.
      private CompilationDetails compilationDetails  
      (package private) double computingTime
      Keeps computing time
      (package private) java.util.List<Constant> constantsList
      List of user defined constants
      private java.lang.String description
      Expression description
      (package private) static boolean DISABLE_ROUNDING  
      (package private) boolean disableRounding
      Internal parameter for calculus expressions to avoid decrease in accuracy.
      private static double EE  
      private static int ERROR_MESSAGE_CALCULATE_MAXIMUM_LENGTH  
      private java.lang.String errorMessage
      Message after checking the syntax
      private java.lang.String errorMessageCalculate
      Optional message from calculate method
      (package private) java.lang.String expressionString
      Expression string (for example: "sin(x)+cos(y)")
      private java.lang.String expressionStringCleaned
      Expression string after attempt to clean
      (package private) boolean expressionWasModified
      if true then new tokenizing is required (the initialTokens list needs to be updated)
      private boolean forwardErrorMessage
      An indicator of whether an error message should be passed from the current expression to the expression that called it.
      (package private) static int FOUND  
      (package private) java.util.List<Function> functionsList
      List of user defined functions
      private static double GG  
      private boolean impliedMultiplicationError
      Fires an error when impliedMultiplicationMode is on and there is a missing multiplication operator
      private boolean impliedMultiplicationMode
      Implied multiplication mode
      private CompilationDetails initialCompilationDetails  
      (package private) java.util.List<Token> initialTokens
      List of expression tokens (words).
      (package private) static boolean INTERNAL
      Marker for internal processing
      private boolean internalClone
      Internal indicator for calculation process Expression.Calculate() method It shows whether to build again tokens list if clone - build again if not clone - build only at the beginning Indicator helps to solve the problem with above definitions Function f = new Function("f(x) = 2*g(x)"); Function g = new Function("g(x) = 2*f(x)"); f.addDefinitions(g); g.addDefinitions(f);
      private boolean isFullyCompiled  
      (package private) static boolean KEEP_ROUNDING_SETTINGS  
      private java.util.List<KeyWord> keyWordsList
      List of keywords known by the parser
      private java.util.Set<java.lang.String> neverParseForImpliedMultiplication
      List of string tokens that should not be considered while seeking for optional implied multiplication.
      private static boolean NO_EXP_STR  
      static boolean NO_SYNTAX_ERRORS
      Status of the syntax - no syntax error
      (package private) static int NOT_FOUND
      FOUND / NOT_FOUND used for matching purposes
      private int optionsChangesetNumber
      mXparser options changeset used in checkSyntax() method
      private boolean parserKeyWordsOnly
      Internal indicator for tokenization process if true, then keywords such as constants functions etc...
      private static double PP  
      private boolean recursionCallPending
      Log used internally to mark started recursion call on the current object, necessary to avoid infinite loops while recursive syntax checking (i.e.
      private int recursionCallsCounter
      Internal counter to avoid infinite loops while calculating expression defined in the way showed by below examples Argument x = new Argument("x = 2*y"); Argument y = new Argument("y = 2*x"); x.addDefinitions(y); y.addDefinitions(x); Function f = new Function("f(x) = 2*g(x)"); Function g = new Function("g(x) = 2*f(x)"); f.addDefinitions(g); g.addDefinitions(f);
      (package private) boolean recursiveMode
      If recursive mode is on the recursive calls are permitted.
      (package private) java.util.List<Expression> relatedExpressionsList
      List of related expressions, for example when user defined function is used in the expression or dependent argument was defined.
      private static int serialClassID  
      private static long serialVersionUID  
      static boolean SYNTAX_ERROR
      Status of the syntax - syntax error or syntax status unknown
      static boolean SYNTAX_ERROR_OR_STATUS_UNKNOWN
      Deprecated.
      Planned to be removed, use SYNTAX_ERROR instead
      private static boolean SYNTAX_STATUS_UNKNOWN  
      private boolean syntaxStatus
      Status of the expression syntax Please referet to the: - NO_SYNTAX_ERRORS - SYNTAX_ERROR - SYNTAX_STATUS_UNKNOWN
      private java.util.List<Token> tokensList
      the initialTokens list keeps unchanged information about found tokens.
      static java.lang.String TYPE_DESC  
      static int TYPE_ID
      Expression type id
      (package private) boolean UDFExpression
      Indicator whether expression was automatically built for user defined functions purpose
      (package private) java.util.List<java.lang.Double> UDFVariadicParamsAtRunTime
      List of parameters provided by the user at run-time
      private boolean unicodeKeyWordsEnabled
      Internal indicator informing hte parser that unicode know keywords are enabled and will be recognized by the parser as built-in functions or operators
      private boolean verboseMode
      Verbose mode prints processing info calls System.out.print* methods
      private static boolean WITH_EXP_STR
      For verbose mode purposes
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      (package private) Expression​(java.lang.String expressionString, boolean parserKeyWordsOnly)
      Constructor - creates new expression from expression string.
      (package private) Expression​(java.lang.String expressionString, java.util.List<Argument> argumentsList, java.util.List<Function> functionsList, java.util.List<Constant> constantsList, boolean internal, boolean UDFExpression, java.util.List<java.lang.Double> UDFVariadicParamsAtRunTime)
      Package level constructor - creates new expression from expression string, arguments list, functions list and constants list (used by the RecursiveArgument class).
      (package private) Expression​(java.lang.String expressionString, java.util.List<Token> initialTokens, java.util.List<Argument> argumentsList, java.util.List<Function> functionsList, java.util.List<Constant> constantsList, boolean disableUlpRounding, boolean UDFExpression, java.util.List<java.lang.Double> UDFVariadicParamsAtRunTime)
      Package level constructor - creates new expression from subexpression (sublist of the tokens list), arguments list, functions list and constants list (used by the internal calculus operations, etc...).
        Expression​(java.lang.String expressionString, PrimitiveElement... elements)
      Constructor - creates new expression from expression string.
      private Expression​(Expression expressionToClone, boolean isThreadSafeClone, CloneCache cloneCache)  
        Expression​(PrimitiveElement... elements)
      Default constructor - empty expression
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void ABS​(int pos)
      Absolut value Sets tokens to number token
      private void ACOS​(int pos)
      Arcus cosine / Inverse trigonometric functions Sets tokens to number token
      private void ACTAN​(int pos)
      Arcus cotangent / Inverse trigonometric functions Sets tokens to number token
      void addArguments​(Argument... arguments)
      Adds arguments (variadic) to the expression definition.
      void addConstants​(java.util.List<Constant> constantsList)
      Adds constants to the expression definition.
      void addConstants​(Constant... constants)
      Adds constants (variadic parameters) to the expression definition.
      void addDefinitions​(PrimitiveElement... elements)
      Adds user defined elements (such as: Arguments, Constants, Functions) to the expressions.
      private void addFractionToken​(Token token)
      Adds fraction token to the tokens list
      void addFunctions​(Function... functions)
      Adds functions (variadic parameters) to the expression definition.
      (package private) void addRelatedExpression​(Expression expression)
      Adds related expression The same expression could be added more than once For example when
      private void addToken​(java.lang.String tokenStr, KeyWord keyWord)  
      private void addToken​(java.lang.String tokenStr, KeyWord keyWord, boolean parenthesisIsOnTheRight)
      Adds expression token Method is called by the tokenExpressionString() while parsing string expression
      private void addUserDefinedKeyWords()  
      private void AND​(int pos)
      Logical AND
      private void AND_VARIADIC​(int pos)
      AND_VARIADIC
      private int applySequenceFromCompilation​(CalcStepsRegister calcStepsRegister, java.lang.String stepDescription)  
      private void ARCCSC​(int pos)
      Arcuus cosecant Sets tokens to number token
      private void ARCOSH​(int pos)
      Arcus hyperbolic cosine Sets tokens to number token
      private void ARCOTH​(int pos)
      Arcus hyperbolic cotangent Sets tokens to number token
      private void ARCSCH​(int pos)
      Arcus hyperbolic cosecant Sets tokens to number token
      private void ARCSEC​(int pos)
      Arcuus secant Sets tokens to number token
      private void ARGMAX_VARIADIC​(int pos)
      ARGMAX_VARIADIC
      private void ARGMIN_VARIADIC​(int pos)
      ARGMIN_VARIADIC
      private void ARSECH​(int pos)
      Arcus hyperbolic secant Sets tokens to number token
      private void ARSINH​(int pos)
      Arcus hyperbolic sine Sets tokens to number token
      private void ARTANH​(int pos)
      Arcus hyperbolic tangent Sets tokens to number token
      private void ASIN​(int pos)
      Arcus sine / Inverse trigonometric functions Sets tokens to number token
      private void assignKnownKeyword​(Token token, KeyWord keyWord)
      Assign found known keyword to the token
      private void ATAN​(int pos)
      Arcus tangent / Inverse trigonometric functions Sets tokens to number token
      private void AVG​(int pos)
      Average function value - iterative operator avg(i,m,n,f(i),b) --> avg f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
      private void AVG_VARIADIC​(int pos)
      Average variadic Sets tokens to number token
      private void BACKWARD_DIFFERENCE​(int pos)
      Backward diffrence operator
      private void BASE_VARIADIC​(int pos)
      BASE_VARIADIC
      private void BELL_NUMBER​(int pos)
      Bell numbers
      private void BERNOULLI_NUMBER​(int pos)
      Bernoulli Number
      private void BETA​(int pos)
      Beta special function
      private void BINOM_COEFF​(int pos)
      Binomial Coefficient
      private void BITWISE_AND​(int pos)
      Bitwise AND
      private void BITWISE_COMPL​(int pos)
      Bitwise COMPL
      private void BITWISE_LEFT_SHIFT​(int pos)
      Bitwise LEFT SHIFT
      private void BITWISE_NAND​(int pos)
      Bitwise NAND
      private void BITWISE_NOR​(int pos)
      Bitwise NOR
      private void BITWISE_OR​(int pos)
      Bitwise OR
      private void BITWISE_RIGHT_SHIFT​(int pos)
      Bitwise RIGHT SHIFT
      private void BITWISE_XNOR​(int pos)
      Bitwise NOR
      private void BITWISE_XOR​(int pos)
      Bitwise XOR
      private void bitwiseCalc​(int pos)
      Calculates Bitwise operators
      private void bolCalc​(int pos)
      Calculates boolean operators
      private void calcSetDecreaseRemove​(int pos, double result)  
      private void calcSetDecreaseRemove​(int pos, double result, boolean ulpRound)
      SetDecreaseRemove for calculus operators.
      double calculate()
      Calculates the expression value and registers all the calculation steps
      double calculate​(CalcStepsRegister calcStepsRegister)
      Calculates the expression value
      private int calculateFirstAndFullyCompile​(CalcStepsRegister calcStepsRegister, java.lang.String stepDescription)  
      private double calculateInternal​(CalcStepsRegister calcStepsRegister)  
      private void calculusCalc​(int pos)
      Calculates calculus operators
      private void CDF_CHI2​(int pos)  
      private void CDF_F_SNEDECOR​(int pos)
      Cumulative Distribution Function - Snedecor's F distribution
      private void CDF_NORMAL​(int pos)
      Cumulative Distribution Function - Normal distribution
      private void CDF_STUDENT_T​(int pos)  
      private void CDF_UNIFORM_CONT​(int pos)
      Cumulative Distribution Function - Uniform Continuous distribution
      private void CEIL​(int pos)
      Ceil function Sets tokens to number token
      private boolean checkArgumentNameInCalculusOperator​(Token token)
      Method used in case of implied multiplication, where x2x can be understood as x2*x sum( x2x, 1, 20, 2*x2x) x2x is not known and it will be prevented from split into x2*x
      private int checkCalculusParameter​(java.lang.String param)
      Checks syntax of the calculus parameter
      private boolean checkFraction​(Token token)
      Checks whether unknown token represents fraction provided as fraction or mixed fraction
      boolean checkIfAttemptToFixExpStrMode()
      Gets attempt to fix expression string mode
      boolean checkIfImpliedMultiplicationMode()
      Gets implied multiplication status
      private static boolean checkIfKnownArgument​(FunctionParameter param)
      Checks if argument given in the function parameter is known in the expression.
      boolean checkIfUnicodeBuiltinKeyWordsMode()
      Gets unicode built-in parser keywords mode
      private static boolean checkIfUnknownToken​(FunctionParameter param)
      Checks if token is uknown
      private boolean checkInternalSyntaxCalculusOperatorDerivative​(java.lang.String recursionInfoLevel, Token token, java.lang.String tokenInfoMessage, java.util.Stack<SyntaxStackElement> syntaxStack, int paramsNumber, java.util.List<FunctionParameter> funParams)  
      private boolean checkInternalSyntaxCalculusOperatorDerivativeNth​(java.lang.String recursionInfoLevel, Token token, java.lang.String tokenInfoMessage, java.util.Stack<SyntaxStackElement> syntaxStack, int paramsNumber, java.util.List<FunctionParameter> funParams)  
      private boolean checkInternalSyntaxCalculusOperatorForwardBackwardDiff​(java.lang.String recursionInfoLevel, Token token, java.lang.String tokenInfoMessage, java.util.Stack<SyntaxStackElement> syntaxStack, int paramsNumber, java.util.List<FunctionParameter> funParams)  
      private boolean checkInternalSyntaxCalculusOperatorIntegralSolve​(java.lang.String recursionInfoLevel, Token token, java.lang.String tokenInfoMessage, java.util.Stack<SyntaxStackElement> syntaxStack, int paramsNumber, java.util.List<FunctionParameter> funParams)  
      private boolean checkInternalSyntaxCalculusOperatorIterated​(java.lang.String recursionInfoLevel, Token token, java.lang.String tokenInfoMessage, java.util.Stack<SyntaxStackElement> syntaxStack, int paramsNumber, java.util.List<FunctionParameter> funParams)  
      boolean checkLexSyntax()
      Checks syntax of the expression string.
      private boolean checkNumberNameManyImpliedMultiplication​(Token token, boolean parenthesisIsOnTheRight)
      Handles implied multiplication logic in case of a single continuous string, e.g.
      private boolean checkOtherNumberBases​(Token token)
      Checks whether unknown token represents number literal provided in different numeral base system, where base is between 1 and 36.
      private boolean checkPartialSyntaxBinaryFunction​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenInfoMessage)  
      private boolean checkPartialSyntaxBuiltinConstant​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenInfoMessage)  
      private boolean checkPartialSyntaxCalculusOperator​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenInfoMessage, java.util.Stack<SyntaxStackElement> syntaxStack)  
      private boolean checkPartialSyntaxDuplicatedKeywords​(java.lang.String recursionInfoLevel)  
      private boolean checkPartialSyntaxImpliedMultiplication​(java.lang.String recursionInfoLevel)  
      private boolean checkPartialSyntaxInvalidToken​(java.lang.String recursionInfoLevel, Token token, java.lang.String tokenInfoMessage, java.util.Stack<SyntaxStackElement> syntaxStack)  
      private boolean checkPartialSyntaxTernaryFunction​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenInfoMessage)  
      private boolean checkPartialSyntaxUnaryFunction​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenInfoMessage)  
      private boolean checkPartialSyntaxUserDefinedArgument​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenInfoMessage)  
      private boolean checkPartialSyntaxUserDefinedConstant​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenStr)  
      private boolean checkPartialSyntaxUserDefinedFunction​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenInfoMessage)  
      private boolean checkPartialSyntaxUserDefinedRecursiveArgument​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenInfoMessage)  
      private boolean checkPartialSyntaxVariadicFunction​(java.lang.String recursionInfoLevel, int tokenIndex, Token token, java.lang.String tokenInfoMessage)  
      private boolean checkSpecialConstantName​(Token token)
      Check whether we have a case of '[abc]'
      boolean checkSyntax()
      Checks syntax of the expression string.
      private boolean checkSyntax​(java.lang.String recursionInfoLevel, boolean functionWithBodyExt)
      Checking the syntax (recursively).
      private void CHI​(int pos)
      Characteristic function (a,b)
      private void CHI_L​(int pos)
      Characteristic function [a,b)
      private void CHI_LR​(int pos)
      Characteristic function [a,b]
      private void CHI_R​(int pos)
      Characteristic function (a,b]
      private void CIMP​(int pos)
      Logical CIMP
      private void cleanExpressionString()
      Cleans blanks and other cases like "++', "+-", "-+"", "--"
      void clearDescription()
      Clears expression description
      void clearExpressionString()
      Clears expression string
      private void clearParamArgument​(ArgumentParameter argParam)
      Clears argument parameter.
      protected Expression clone()
      Expression cloning.
      Expression cloneForThreadSafe()
      Creates a completely independent 1-1 clone that can be safely used by a separate thread.
      (package private) Expression cloneForThreadSafeInternal​(CloneCache cloneCache)  
      private void CNIMP​(int pos)
      Logical CNIMP
      private void COALESCE​(int pos)
      Coalesce
      private void COMMA​(int pos)
      Parser symbols Removes comma
      void consolePrintCopyOfInitialTokens()
      Prints to the console copy of initial tokens.
      private void CONSTANT​(int pos)
      Constants handling.
      private void CONTINUED_FRACTION​(int pos)
      Continued fraction
      private void CONTINUED_POLYNOMIAL​(int pos)
      Continued polynomial
      private void copyInitialTokens()
      copy initial tokens list to tokens list and prepares initial compilation details
      private void COS​(int pos)
      Cosine / Trigonometric functions Sets tokens to number token
      private void COSEC​(int pos)
      Cosecant / Trigonometric functions Sets tokens to number token
      private void COSH​(int pos)
      Hyperbolic cosine Sets tokens to number token
      private void COTH​(int pos)
      Hyperbolic cotangent Sets tokens to number token
      private static java.util.List<Token> createInitialTokens​(int startPos, int endPos, java.util.List<Token> tokensList)
      Creates string tokens list from the subexpression.
      private void CSCH​(int pos)
      Hyperbolic cosecant Sets tokens to number token
      private void CTAN​(int pos)
      Cotangent / Trigonometric functions Sets tokens to number token
      private void CUBE_ROOT_OPERATOR​(int pos)
      Cube root as unary left operator
      void defineArgument​(java.lang.String argumentName, double argumentValue)
      Enables to define the argument (associated with the expression) based on the argument name and the argument value.
      void defineArguments​(java.lang.String... argumentsNames)
      Enables to define the arguments (associated with the expression) based on the given arguments names.
      void defineConstant​(java.lang.String constantName, double constantValue)
      Enables to define the constant (associated with the expression) based on the constant name and constant value.
      void defineFunction​(java.lang.String functionName, java.lang.String functionExpressionString, java.lang.String... argumentsNames)
      Enables to define the function (associated with the expression) based on the function name, function expression string and arguments names (variadic parameters).
      private void DEG​(int pos)
      Converts radians to degrees Sets tokens to number token
      private void DEPENDENT_ARGUMENT​(int pos, CalcStepsRegister calcStepsRegister)
      Dependent Arguments handling.
      private void DERIVATIVE​(int pos, int derivativeType)
      Function derivative
      private void DERIVATIVE_NTH​(int pos, int derivativeType)
      Function derivative
      private void DI_GAMMA​(int pos)
      Digamma special function Sets tokens to number token
      private void DIGIT​(int pos)
      Digit at position - numeral system with given base
      private void DIGIT10​(int pos)
      Digit at position - base 10 numeral system
      void disableAttemptToFixExpStrMode()
      Disables attempt to fix the expression String.
      void disableImpliedMultiplicationMode()
      Disables implied multiplication
      (package private) void disableRecursiveMode()
      Disables recursive mode
      void disableUnicodeBuiltinKeyWordsMode()
      Disables unicode built-in parser keywords, this flag informs the parser that built-in unicode keywords are not supported and will not be recognized as functions or operators.
      private void DIVIDE​(int pos)
      Division handling.
      private void DIVIDE_QUOTIENT​(int pos)
      Integer division handling.
      void enableAttemptToFixExpStrMode()
      Enables attempt to fix the expression String.
      void enableImpliedMultiplicationMode()
      Sets implied multiplication
      void enableUnicodeBuiltinKeyWordsMode()
      Enables unicode built-in parser keywords, this flag informs the parser that built-in unicode keywords are supported and will be recognized as functions or operators.
      private void EQ​(int pos)
      Equality relation.
      private void EQV​(int pos)
      Logical EQV
      private void EULER_NUMBER​(int pos)
      Euler number
      private void EULER_POLYNOMIAL​(int pos)
      Euler polynomial
      private void evalFromToDeltaParameters​(ArgumentParameter index, IterativeOperatorParameters iterParams)
      Evaluates ranges 'from', 'to', 'delta' for the iterative operator
      private void EXP​(int pos)
      Exponential function Sets tokens to number token
      private void EXP_INT​(int pos)
      Exponential integral function
      private void expressionInit()
      Common elements while expression initializing
      private void expressionInternalVarsInit()
      Common variables while expression initializing
      private void f1ArgCalc​(int pos)
      Calculates unary function
      private void f1SetDecreaseRemove​(int pos, double result)  
      private void f1SetDecreaseRemove​(int pos, double result, boolean ulpRound)
      SetDecreaseRemove for 1 arg functions SetDecreaseRemove like methods are called by the methods calculating values of the unary operation, binary relations and functions.
      private void f2ArgCalc​(int pos)
      Calculates binary function
      private void f2SetDecreaseRemove​(int pos, double result)  
      private void f2SetDecreaseRemove​(int pos, double result, boolean ulpRound)
      SetDecreaseRemove for 2-args functions For detailed specification refer to the f1SetDecreaseRemove()
      private void f3ArgCalc​(int pos)
      Calculates function with 3 arguments
      private void f3SetDecreaseRemove​(int pos, double result)  
      private void f3SetDecreaseRemove​(int pos, double result, boolean ulpRound)
      SetDecreaseRemove for 3-args functions For detailed specification refer to the f1SetDecreaseRemove()
      private void FACT​(int pos)
      Factorilal function Sets tokens to number token
      private void FACTEXP​(int pos)
      Prime factor value exponent
      private void FACTVAL​(int pos)
      Prime factor value
      private void FIBONACCI_NUMBER​(int pos)
      Fibonacci numbers
      private void FLOOR​(int pos)
      Floor function Sets tokens to number token
      private void FORWARD_DIFFERENCE​(int pos)
      Forward difference operator
      private void FOURTH_ROOT_OPERATOR​(int pos)
      Fourth root as unary left operator
      private void FREE_ARGUMENT​(int pos)
      Free Arguments handling.
      private void GAMMA​(int pos)
      Gamma special function Sets tokens to number token
      private void GAUSS_ERF​(int pos)
      Gauss error function
      private void GAUSS_ERF_INV​(int pos)
      Inverse of Gauss error function
      private void GAUSS_ERFC​(int pos)
      Gauss complementary error function
      private void GAUSS_ERFC_INV​(int pos)
      Inverse of Gauss complementary error function
      private void GCD​(int pos)
      Greates Common Divisor
      private void GEQ​(int pos)
      Greater or equal
      Argument getArgument​(int argumentIndex)
      Gets argument from the expression.
      Argument getArgument​(java.lang.String argumentName)
      Gets argument from the expression.
      int getArgumentIndex​(java.lang.String argumentName)
      Gets argument index from the expression.
      int getArgumentsNumber()
      Gets number of arguments associated with the expression.
      double getArgumentValue​(java.lang.String argumentName)
      Gets argument vale.
      java.lang.String getCanonicalExpressionString()
      Returns expression string
      double getComputingTime()
      Gets computing time.
      Constant getConstant​(int constantIndex)
      Gets constant associated with the expression.
      Constant getConstant​(java.lang.String constantName)
      Gets constant associated with the expression.
      int getConstantIndex​(java.lang.String constantName)
      Gets constant index associated with the expression.
      int getConstantsNumber()
      Gets number of constants associated with the expression.
      java.util.List<Token> getCopyOfInitialTokens()
      Tokenizes expression string and returns tokens list, including: string, type, level.
      java.lang.String getDescription()
      Gets expression description.
      java.lang.String getErrorMessage()
      Method return error message after calling checkSyntax() method or calculate().
      java.lang.String getExpressionString()
      Returns expression string
      Function getFunction​(int functionIndex)
      Gets function associated with the expression.
      Function getFunction​(java.lang.String functionName)
      Gets function associated with the expression.
      int getFunctionIndex​(java.lang.String functionName)
      Gets index of function associated with the expression.
      int getFunctionsNumber()
      Gets number of functions associated with the expression.
      java.lang.String getHelp()
      Returns detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelp​(boolean addHeader, boolean addCaption, java.lang.String caption)
      Returns detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelp​(java.lang.String query)
      Returns detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelp​(java.lang.String query, boolean addHeader, boolean addCaption, java.lang.String caption)
      Returns detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsCsv()
      Returns (as CSV) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsCsv​(java.lang.String query)
      Returns (as CSV) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsCsv​(java.lang.String quote, java.lang.String delimiter, boolean addHeader)
      Returns (as CSV) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsCsv​(java.lang.String query, java.lang.String quote, java.lang.String delimiter, boolean addHeader)
      Returns (as CSV) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsHtmlTable()
      Returns (as HTML table) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsHtmlTable​(boolean addHeader, boolean addCaption, boolean addFigure, java.lang.String caption, java.lang.String cssClass)
      Returns (as HTML table) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsHtmlTable​(java.lang.String query)
      Returns (as HTML table) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsHtmlTable​(java.lang.String query, boolean addHeader, boolean addCaption, boolean addFigure, java.lang.String caption, java.lang.String cssClass)
      Returns (as HTML table) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsJson()
      Returns (as Json) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsJson​(boolean addCaption, java.lang.String caption)
      Returns (as Json) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsJson​(java.lang.String query)
      Returns (as Json) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsJson​(java.lang.String query, boolean addCaption, java.lang.String caption)
      Returns (as Json) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsMarkdownTable()
      Returns (as Markdown table) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsMarkdownTable​(boolean addHeader, boolean addCaption, java.lang.String caption)
      Returns (as Markdown table) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsMarkdownTable​(java.lang.String query)
      Returns (as Markdown table) detailed user help on the syntax of mathematical expressions.
      java.lang.String getHelpAsMarkdownTable​(java.lang.String query, boolean addHeader, boolean addCaption, java.lang.String caption)
      Returns (as Markdown table) detailed user help on the syntax of mathematical expressions.
      (package private) java.util.List<Token> getInitialTokens()
      Gets initial tokens and returns copied list
      java.util.List<KeyWord> getKeyWords()
      Returns list of keywords known to the parser
      java.util.List<KeyWord> getKeyWords​(java.lang.String query)
      Returns list of keywords known to the parser.
      java.lang.String[] getMissingUserDefinedArguments()
      Returns missing user defined arguments names, i.e.
      java.lang.String[] getMissingUserDefinedFunctions()
      Returns missing user defined functions names, i.e.
      java.lang.String[] getMissingUserDefinedUnits()
      Returns missing user defined units names, i.e.
      private java.util.List<java.lang.Double> getNumbers​(int pos)
      Creates ArraList containing function parameters
      private ArgumentParameter getParamArgument​(java.lang.String argumentName)
      Gets / returns argument representing given argument name.
      private int getParametersNumber​(int pos)
      Return number of functions parameters.
      boolean getRecursiveMode()
      Gets recursive mode status
      boolean getSyntaxStatus()
      Gets syntax status of the expression.
      private double getTokenValue​(int tokenIndex)
      Gets token value
      boolean getVerboseMode()
      Returns verbose mode status.
      private void GT​(int pos)
      Greater than.
      private void HARMONIC_NUMBER​(int pos)
      Harmonic numbers
      private void HARMONIC2_NUMBER​(int pos)
      Harmonic numbers
      private void IF​(int pos)
      IF Sets tokens to number token
      private void IF_CONDITION​(int pos)
      IF function
      private void IFF​(int pos)
      IFF function
      private void ifSetRemove​(int pos, double ifCondition)  
      private void ifSetRemove​(int pos, double ifCondition, boolean ulpRound)
      If set remove method for the if function.
      private void IMP​(int pos)
      Logical IMP
      private void INC_BETA​(int pos)
      Incomplete beta special function
      private void INC_GAMMA_LOWER​(int pos)
      Lower incomplete special Gamma function
      private void INC_GAMMA_UPPER​(int pos)
      Upper incomplete special Gamma function
      private void initialTokensAdd​(Token token)
      Handles implied multiplication while adding single token to the tokens list is checking preceding token
      private void initialTokensAddTokenPart​(TokenPart tokenPart)
      Handles adding token part after single token split in the proces of parsing implied multiplication.
      private void initParserKeyWords()
      Creates parser keywords list
      private void INTEGRAL​(int pos)
      Function integral
      private void IS_PRIME​(int pos)
      Prime test
      private void ISNAN​(int pos)
      Is Not-a-Number Sets tokens to number token
      private void KRONECKER_DELTA​(int pos)
      Kronecker delta
      private void LAMBERT_W0​(int pos)
      Lambert-W special function, principal branch 0 Sets tokens to number token
      private void LAMBERT_W1​(int pos)
      Lambert-W special function, branch = -1 Sets tokens to number token
      private void LCM​(int pos)
      Lowest Common Multiply
      private void LEQ​(int pos)
      Lower or equal.
      private void LN​(int pos)
      Natural logarithm (base e) Sets tokens to number token
      private void LOG​(int pos)
      Logarithm Sets tokens to number token
      private void LOG_BETA​(int pos)
      Log beta special function
      private void LOG_GAMMA​(int pos)
      Log Gamma special function Sets tokens to number token
      private void LOG_INT​(int pos)
      Logarithmic exponential integral function
      private void LOG10​(int pos)
      Logarithm - base 10 Sets tokens to number token
      private void LOG2​(int pos)
      Logarithm - base 2 Sets tokens to number token
      private void LT​(int pos)
      Lower than.
      private void LUCAS_NUMBER​(int pos)
      Lucas numbers
      private java.lang.String makeStepDescription()  
      (package private) void markAsNotFullyCompiled()  
      private void MAX​(int pos)
      Maximum value - iterative operator maxi(i,m,n,f(i),b) --> max f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
      private void MAX_VARIADIC​(int pos)
      Maximum variadic Sets tokens to number token
      private void MEDIAN_VARIADIC​(int pos)
      MEDIAN_VARIADIC
      private void MIN​(int pos)
      Minimum value - iterative operator mini(i,m,n,f(i),b) --> min f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
      private void MIN_VARIADIC​(int pos)
      Minimum variadic Sets tokens to number token
      private void MINUS​(int pos)
      Subtraction handling
      private void MOD​(int pos)
      Modulo Sets tokens to number token
      private void MODE_VARIADIC​(int pos)
      MODE_VARIADIC
      private void modifyParserKeyWords()  
      private void MODULO​(int pos)
      Modulo handling.
      private void MULTIPLY​(int pos)
      Multiplication handling.
      private void NAND​(int pos)
      Logical NAND
      private void NDIG​(int pos)
      Number of digits in given numeral system
      private void NDIG10​(int pos)
      Number of digits in base 10 Sets tokens to number token
      private void NDIST_VARIADIC​(int pos)
      NDIST_VARIADIC
      private void NEG​(int pos)
      Logical negation
      private void NEQ​(int pos)
      Not equals.
      private void NFACT​(int pos)
      Number of prime factors - distinct Sets tokens to number token
      private void NIMP​(int pos)
      Logical NIMP
      private void NOR​(int pos)
      Logical NOR
      private void NOT​(int pos)
      Negation Sets tokens to number token
      private void OFF_LOG_INT​(int pos)
      Offset logarithmic exponential integral function
      private void opSetDecreaseRemove​(int pos, double result)  
      private void opSetDecreaseRemove​(int pos, double result, boolean ulpRound)
      SetDecreaseRemove for operators For detailed specification refer to the f1SetDecreaseRemove()
      private void OR​(int pos)
      Logical OR
      private void OR_VARIADIC​(int pos)
      OR_VARIADIC
      private void PARENTHESES​(int lPos, int rPos)
      Parser symbols Removes parenthesis
      private void PDF_CHI2​(int pos)  
      private void PDF_F_SNEDECOR​(int pos)
      Probability Distribution Function - Snedecor's F distribution
      private void PDF_NORMAL​(int pos)
      Probability Distribution Function - Normal distribution
      private void PDF_STUDENT_T​(int pos)  
      private void PDF_UNIFORM_CONT​(int pos)
      Probability Distribution Function - Uniform Continuous distribution
      private void PERC​(int pos)
      Percentage Sets tokens to number token
      private static void performSyntaxStackPopIfEndOfSectionLevel​(Token token, java.util.Stack<SyntaxStackElement> syntaxStack)  
      private void PERMUTATIONS​(int pos)
      Number of permutations
      private void PLUS​(int pos)
      Addition handling.
      private void POWER​(int pos)
      Power handling.
      private void PRIME_COUNT​(int pos)
      Prime counting
      private void printSystemInfo​(java.lang.String info, boolean withExpressionString)  
      private void PROD​(int pos)
      Product operator (SIGMA by) pord(i,m,n,f(i),b) --> prod f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
      private void PROD_VARIADIC​(int pos)
      Sum variadic Sets tokens to number token
      private void QNT_CHI2​(int pos)  
      private void QNT_F_SNEDECOR​(int pos)
      Quantile Function - Snedecor's F distribution
      private void QNT_NORMAL​(int pos)
      Quantile Function - Normal distribution
      private void QNT_STUDENT_T​(int pos)  
      private void QNT_UNIFORM_CONT​(int pos)
      Quantile Function - Uniform Continuous distribution
      private void RAD​(int pos)
      Converts degrees to radius Sets tokens to number token
      private void RANDOM_VARIABLE​(int pos)
      Random Variables handling.
      private void RECURSIVE_ARGUMENT​(int pos)
      Recursive arguments handling.
      private void REG_BETA​(int pos)
      Regularized incomplete beta special function
      private void REG_GAMMA_LOWER​(int pos)
      Lower regularized special Gamma function
      private void REG_GAMMA_UPPER​(int pos)
      Lower regularized special Gamma function
      private void registerCalculationStepRecord​(CalcStepsRegister calcStepsRegister, int stepsRegisteredCounter, java.lang.String stepDescription)  
      private void registerCalculationStepRecord​(CalcStepsRegister calcStepsRegister, int stepsRegisteredCounter, java.lang.String stepDescription, double result)  
      private void registerCompiledElement​(CompiledElement.ToCall toCall, int position)  
      private void registerCompiledElement​(CompiledElement.ToCall toCall, int position1, int position2)  
      private void registerErrorWhileCalculate​(java.lang.String errorMessageToAdd)  
      private void registerFinalSyntax​(java.lang.String recursionInfoLevel, boolean syntax)  
      private void registerFinalSyntaxAlreadyCheckedNorErrors​(java.lang.String recursionInfoLevel)  
      private void registerFinalSyntaxExpressionStringIsEmpty​(java.lang.String recursionInfoLevel)  
      private void registerFinalSyntaxFunctionWithBodyExtNoErrors​(java.lang.String recursionInfoLevel)  
      private void registerPartialSyntaxStartingSyntaxCheck​(java.lang.String recursionInfoLevel)  
      private void registerSyntaxLexicalError​(java.lang.String recursionInfoLevel, java.lang.Throwable e)  
      void removeAllArguments()
      Removes all arguments associated with the expression.
      void removeAllConstants()
      Removes all constants associated with the expression
      void removeAllFunctions()
      Removes all functions associated with the expression.
      void removeArguments​(java.lang.String... argumentsNames)
      Removes first occurrences of the arguments associated with the expression.
      void removeArguments​(Argument... arguments)
      Removes first occurrences of the arguments associated with the expression.
      void removeConstants​(java.lang.String... constantsNames)
      Removes first occurrences of the constants associated with the expression.
      void removeConstants​(Constant... constants)
      Removes first occurrences of the constants associated with the expression
      void removeDefinitions​(PrimitiveElement... elements)
      Removes user defined elements (such as: Arguments, Constants, Functions) to the expressions.
      void removeFunctions​(java.lang.String... functionsNames)
      Removes first occurrences of the functions associated with the expression.
      void removeFunctions​(Function... functions)
      Removes first occurrences of the functions associated with the expression.
      (package private) void removeRelatedExpression​(Expression expression)
      Removes related expression
      private void removeTokens​(int from, int to)  
      private void RND_CHI2​(int pos)  
      private void RND_F_SNEDECOR​(int pos)
      Random number - Snedecor's F distribution (F-distribution or F-ratio, also known as Fisher–Snedecor distribution)
      private void RND_LIST​(int pos)
      Random number from list
      private void RND_NORMAL​(int pos)
      Random number - Normal distribution
      private void RND_STUDENT_T​(int pos)  
      private void RND_VAR_UNIFORM_CONT​(int pos)
      Random number - Uniform Continuous distribution
      private void RND_VAR_UNIFORM_DISCR​(int pos)
      Random number - Uniform Discrete distribution
      private void ROOT​(int pos)
      Nth order root
      private void rootOperCalc​(int pos)
      Unicode root operators
      private void ROUND​(int pos)
      Decimal rounding
      private void SA​(int pos)
      SA / sinc normalized
      private void SEC​(int pos)
      Secant / Trigonometric functions Sets tokens to number token
      private void SECH​(int pos)
      Hyperbolic secant Sets tokens to number token
      void setArgumentValue​(java.lang.String argumentName, double argumentValue)
      Sets argument value.
      void setDescription​(java.lang.String description)
      Sets expression description.
      (package private) void setExpressionModifiedFlag()
      Sets expression status to modified Calls setExpressionModifiedFlag() method to all related expressions.
      void setExpressionString​(java.lang.String expressionString)
      Sets (modifies expression) expression string.
      (package private) void setForwardErrorMessage​(boolean forward)
      An indicator of whether an error message should be passed from the current expression to the expression that called it.
      (package private) void setRecursiveMode()
      Sets recursive mode
      void setSilentMode()
      Disables verbose mode (default silent mode).
      (package private) void setSyntaxStatus​(boolean syntaxStatus, java.lang.String errorMessage)
      Package level method for passing information about errors identified on the constructors level
      private void setToNumber​(int pos, double number)  
      private void setToNumber​(int pos, double number, boolean ulpRound)
      Sets given token to the number type / value.
      void setVerboseMode()
      Enables verbose mode.
      private void SGN​(int pos)
      Signum function Sets tokens to number token
      private void SGN_GAMMA​(int pos)
      Signum of Gamma special function Sets tokens to number token
      private void showArguments()  
      (package private) void showInitialTokens()
      shows initial tokens
      (package private) void showKeyWords()
      shows known keywords
      private void showParsing​(int lPos, int rPos)
      Shows parsing (verbose mode purposes).
      (package private) void showRelatedExpressions()
      Prints related expression list
      (package private) void showTokens()  
      (package private) static void showTokens​(java.util.List<Token> tokensList)  
      private void SIN​(int pos)
      Sine function
      private void SINC​(int pos)
      Sinc unnormalized
      private void SINH​(int pos)
      Hyperbolic sine Sets tokens to number token
      private void SOLVE​(int pos)
      Function SOLVE
      private void SQRT​(int pos)
      Square root Sets tokens to number token
      private void SQUARE_ROOT_OPERATOR​(int pos)
      Square root as unary left operator
      private void STD​(int pos)
      Standard deviation from sample function values - iterative operator stdi(i,m,n,f(i),b) --> std f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
      private void STD_VARIADIC​(int pos)
      Standard deviation variadic Sets tokens to number token
      private void STIRLING1_NUMBER​(int pos)
      Stirling number of the first kind
      private void STIRLING2_NUMBER​(int pos)
      Stirling number of the second kind.
      private void SUM​(int pos)
      Summation operator (SIGMA by) sum(i,m,n,f(i),b) --> sum f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
      private void SUM_VARIADIC​(int pos)
      Sum variadic Sets tokens to number token
      private boolean syntaxIsAlreadyCheckedNorErrors()  
      private void TAN​(int pos)
      Tangent / Trigonometric functions Sets tokens to number token
      private void TANH​(int pos)
      Hyperbolic tangent Sets tokens to number token
      private void TETRATION​(int pos)
      Tetration handling.
      private void tokenizeExpressionString()
      Tokenizing expression string
      private boolean tryAssignKnownKeyword​(Token token)
      Tries to find known keyword for a given token via string matching
      private KeyWord tryFindKnownKeyword​(java.lang.String tokenStr)
      Tries to find known keyword for a given token via string matching
      private void UDF_PARAM​(int pos)
      User Defined Variadic function param value Sets tokens to number token
      private void ULP​(int pos)
      Unit in The Last Place Sets tokens to number token
      private void UNIT​(int pos)
      Constants handling.
      private static void updateMissingTokens​(java.util.List<Token> tokens, java.lang.String keyWord, int tokenId, int tokenTypeId)
      Updating missing tokens (i.e.
      private static void updateMissingTokens​(ArgumentParameter index, IterativeOperatorParameters iterParams)
      Update missing tokens in expression related to iterative operators.
      private void USER_CONSTANT​(int pos)
      User constants handling.
      private void USER_FUNCTION​(int pos, CalcStepsRegister calcStepsRegister)
      User functions handling.
      private void validateParserKeyWords()
      Final validation of keywords
      private void VAR​(int pos)
      Variance from sample function values - iterative operator vari(i,m,n,f(i),b) --> var f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
      private void VAR_VARIADIC​(int pos)
      Variance variadic Sets tokens to number token
      private void variadicFunCalc​(int pos)
      Calculates Variadic function
      private void variadicSetDecreaseRemove​(int pos, double value, int length)  
      private void variadicSetDecreaseRemove​(int pos, double value, int length, boolean ulpRound)
      SetDecreaseRemove for special functions.
      private void WORPITZKY_NUMBER​(int pos)
      Worpitzky number.
      private void XOR​(int pos)
      Logical XOR
      private void XOR_VARIADIC​(int pos)
      XOR_VARIADIC
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
      • TYPE_DESC

        public static java.lang.String TYPE_DESC
      • NOT_FOUND

        static final int NOT_FOUND
        FOUND / NOT_FOUND used for matching purposes
        See Also:
        Constant Field Values
      • WITH_EXP_STR

        private static final boolean WITH_EXP_STR
        For verbose mode purposes
        See Also:
        Constant Field Values
      • NO_SYNTAX_ERRORS

        public static final boolean NO_SYNTAX_ERRORS
        Status of the syntax - no syntax error
        See Also:
        Constant Field Values
      • SYNTAX_ERROR

        public static final boolean SYNTAX_ERROR
        Status of the syntax - syntax error or syntax status unknown
        See Also:
        Constant Field Values
      • SYNTAX_ERROR_OR_STATUS_UNKNOWN

        @Deprecated
        public static final boolean SYNTAX_ERROR_OR_STATUS_UNKNOWN
        Deprecated.
        Planned to be removed, use SYNTAX_ERROR instead
        Status of the syntax - syntax error or syntax status unknown
        See Also:
        Constant Field Values
      • SYNTAX_STATUS_UNKNOWN

        private static final boolean SYNTAX_STATUS_UNKNOWN
        See Also:
        Constant Field Values
      • expressionString

        java.lang.String expressionString
        Expression string (for example: "sin(x)+cos(y)")
      • expressionStringCleaned

        private java.lang.String expressionStringCleaned
        Expression string after attempt to clean
      • description

        private java.lang.String description
        Expression description
      • functionsList

        java.util.List<Function> functionsList
        List of user defined functions
        See Also:
        Function
      • constantsList

        java.util.List<Constant> constantsList
        List of user defined constants
        See Also:
        Constant
      • keyWordsList

        private java.util.List<KeyWord> keyWordsList
        List of keywords known by the parser
      • initialTokens

        java.util.List<Token> initialTokens
        List of expression tokens (words). Token class defines all needed attributes for recognizing the structure of arithmetic expression. This is the key result when initial parsing is finished (tokenizeExpressionString() - method). Token keeps information about: - token type (for example: function, operator, argument, number, etc...) - token identifier within given type (sin, cos, operaotr, etc...) - token value (if token is a number) - token level - key information regarding sequence (order) of further parsing
      • neverParseForImpliedMultiplication

        private java.util.Set<java.lang.String> neverParseForImpliedMultiplication
        List of string tokens that should not be considered while seeking for optional implied multiplication. Example: sum( x2y, 1, 10, 2*x2y) Here x2y should always stay as x2y
      • tokensList

        private java.util.List<Token> tokensList
        the initialTokens list keeps unchanged information about found tokens. While parsing the tokensList is used. The tokensList is the same as initialTokens list at the beginning of the calculation process. Each math operation changes tokens list - it means that tokens are parameters when performing math operation and the result is also presented as token (usually as a number token) At the end of the calculation the tokensList should contain only one element - the result of all calculations.
      • relatedExpressionsList

        java.util.List<Expression> relatedExpressionsList
        List of related expressions, for example when user defined function is used in the expression or dependent argument was defined. Modification of function expression calls the method expression modified flag method to all related expressions. Related expression usually are used for - dependent arguments - recursive arguments - user functions
      • computingTime

        double computingTime
        Keeps computing time
      • expressionWasModified

        boolean expressionWasModified
        if true then new tokenizing is required (the initialTokens list needs to be updated)
      • recursiveMode

        boolean recursiveMode
        If recursive mode is on the recursive calls are permitted. It means there will be no null pointer exceptions due to expression, and functions cloning.
      • verboseMode

        private boolean verboseMode
        Verbose mode prints processing info calls System.out.print* methods
      • impliedMultiplicationMode

        private boolean impliedMultiplicationMode
        Implied multiplication mode
      • impliedMultiplicationError

        private boolean impliedMultiplicationError
        Fires an error when impliedMultiplicationMode is on and there is a missing multiplication operator
      • disableRounding

        boolean disableRounding
        Internal parameter for calculus expressions to avoid decrease in accuracy.
      • syntaxStatus

        private boolean syntaxStatus
        Status of the expression syntax Please referet to the: - NO_SYNTAX_ERRORS - SYNTAX_ERROR - SYNTAX_STATUS_UNKNOWN
      • isFullyCompiled

        private boolean isFullyCompiled
      • errorMessage

        private java.lang.String errorMessage
        Message after checking the syntax
      • errorMessageCalculate

        private java.lang.String errorMessageCalculate
        Optional message from calculate method
      • ERROR_MESSAGE_CALCULATE_MAXIMUM_LENGTH

        private static final int ERROR_MESSAGE_CALCULATE_MAXIMUM_LENGTH
        See Also:
        Constant Field Values
      • recursionCallPending

        private boolean recursionCallPending
        Log used internally to mark started recursion call on the current object, necessary to avoid infinite loops while recursive syntax checking (i.e. f to g and g to f) or marking modified flags on the expressions related to this expression.
        See Also:
        setExpressionModifiedFlag(), checkSyntax()
      • recursionCallsCounter

        private int recursionCallsCounter
        Internal counter to avoid infinite loops while calculating expression defined in the way showed by below examples Argument x = new Argument("x = 2*y"); Argument y = new Argument("y = 2*x"); x.addDefinitions(y); y.addDefinitions(x); Function f = new Function("f(x) = 2*g(x)"); Function g = new Function("g(x) = 2*f(x)"); f.addDefinitions(g); g.addDefinitions(f);
      • parserKeyWordsOnly

        private boolean parserKeyWordsOnly
        Internal indicator for tokenization process if true, then keywords such as constants functions etc... will not be recognized during tokenization
      • unicodeKeyWordsEnabled

        private boolean unicodeKeyWordsEnabled
        Internal indicator informing hte parser that unicode know keywords are enabled and will be recognized by the parser as built-in functions or operators
      • attemptToFixExpStrEnabled

        private boolean attemptToFixExpStrEnabled
        Internal indicator informing the parser whether to try to fix the expression String. For example, situations such as: "++" change to "+", "+-" changed tro "-" "-+" changed tro "-" "--" changed tro "+"
      • UDFExpression

        boolean UDFExpression
        Indicator whether expression was automatically built for user defined functions purpose
        See Also:
        Function
      • UDFVariadicParamsAtRunTime

        java.util.List<java.lang.Double> UDFVariadicParamsAtRunTime
        List of parameters provided by the user at run-time
        See Also:
        Function
      • internalClone

        private boolean internalClone
        Internal indicator for calculation process Expression.Calculate() method It shows whether to build again tokens list if clone - build again if not clone - build only at the beginning Indicator helps to solve the problem with above definitions Function f = new Function("f(x) = 2*g(x)"); Function g = new Function("g(x) = 2*f(x)"); f.addDefinitions(g); g.addDefinitions(f);
      • forwardErrorMessage

        private boolean forwardErrorMessage
        An indicator of whether an error message should be passed from the current expression to the expression that called it.
      • optionsChangesetNumber

        private int optionsChangesetNumber
        mXparser options changeset used in checkSyntax() method
      • PP

        private static final double PP
      • EE

        private static final double EE
      • GG

        private static final double GG
    • Constructor Detail

      • Expression

        public Expression​(PrimitiveElement... elements)
        Default constructor - empty expression
        Parameters:
        elements - Optional elements list (variadic - comma separated) of types: Argument, Constant, Function
        See Also:
        PrimitiveElement
      • Expression

        public Expression​(java.lang.String expressionString,
                          PrimitiveElement... elements)
        Constructor - creates new expression from expression string.
        Parameters:
        expressionString - definition of the expression
        elements - Optional elements list (variadic - comma separated) of types: Argument, Constant, Function
        See Also:
        PrimitiveElement
      • Expression

        Expression​(java.lang.String expressionString,
                   boolean parserKeyWordsOnly)
        Constructor - creates new expression from expression string.
        Parameters:
        expressionString - definition of the expression
        parserKeyWordsOnly - if true then all keywords such as functions, constants, arguments will not be recognized.
      • Expression

        Expression​(java.lang.String expressionString,
                   java.util.List<Token> initialTokens,
                   java.util.List<Argument> argumentsList,
                   java.util.List<Function> functionsList,
                   java.util.List<Constant> constantsList,
                   boolean disableUlpRounding,
                   boolean UDFExpression,
                   java.util.List<java.lang.Double> UDFVariadicParamsAtRunTime)
        Package level constructor - creates new expression from subexpression (sublist of the tokens list), arguments list, functions list and constants list (used by the internal calculus operations, etc...).
        Parameters:
        expressionString - the expression string
        initialTokens - the tokens list (starting point - no tokenizing, no syntax checking)
        argumentsList - the arguments list
        functionsList - the functions list
        constantsList - the constants list
      • Expression

        Expression​(java.lang.String expressionString,
                   java.util.List<Argument> argumentsList,
                   java.util.List<Function> functionsList,
                   java.util.List<Constant> constantsList,
                   boolean internal,
                   boolean UDFExpression,
                   java.util.List<java.lang.Double> UDFVariadicParamsAtRunTime)
        Package level constructor - creates new expression from expression string, arguments list, functions list and constants list (used by the RecursiveArgument class). No related expressions at the beginning.
        Parameters:
        expressionString - the expression string
        argumentsList - the arguments list
        functionsList - the functions list
        constantsList - the constants list
        internal - the marker for internal processing
        See Also:
        Argument, RecursiveArgument, Function, Constant
      • Expression

        private Expression​(Expression expressionToClone,
                           boolean isThreadSafeClone,
                           CloneCache cloneCache)
    • Method Detail

      • addRelatedExpression

        void addRelatedExpression​(Expression expression)
        Adds related expression The same expression could be added more than once For example when
        Parameters:
        expression - the expression
      • removeRelatedExpression

        void removeRelatedExpression​(Expression expression)
        Removes related expression
        Parameters:
        expression - the expression
      • showRelatedExpressions

        void showRelatedExpressions()
        Prints related expression list
      • getErrorMessage

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

        public boolean getSyntaxStatus()
        Gets syntax status of the expression.
        Returns:
        true if there are no syntax errors, false when syntax error was found or syntax status is unknown
      • setSyntaxStatus

        void setSyntaxStatus​(boolean syntaxStatus,
                             java.lang.String errorMessage)
        Package level method for passing information about errors identified on the constructors level
        Parameters:
        syntaxStatus - Syntax status
        errorMessage - Error message
        See Also:
        Function
      • markAsNotFullyCompiled

        void markAsNotFullyCompiled()
      • setExpressionModifiedFlag

        void setExpressionModifiedFlag()
        Sets expression status to modified Calls setExpressionModifiedFlag() method to all related expressions.
      • expressionInternalVarsInit

        private void expressionInternalVarsInit()
        Common variables while expression initializing
      • expressionInit

        private void expressionInit()
        Common elements while expression initializing
      • setExpressionString

        public void setExpressionString​(java.lang.String expressionString)
        Sets (modifies expression) expression string.
        Parameters:
        expressionString - the expression string
      • getExpressionString

        public java.lang.String getExpressionString()
        Returns expression string
        Returns:
        Expression string definition.
      • getCanonicalExpressionString

        public java.lang.String getCanonicalExpressionString()
        Returns expression string
        Returns:
        Expression string definition.
      • clearExpressionString

        public void clearExpressionString()
        Clears expression string
      • setDescription

        public void setDescription​(java.lang.String description)
        Sets expression description.
        Parameters:
        description - the description string
      • getDescription

        public java.lang.String getDescription()
        Gets expression description.
        Returns:
        String description.
      • clearDescription

        public void clearDescription()
        Clears expression description
      • setVerboseMode

        public void setVerboseMode()
        Enables verbose mode.
      • setSilentMode

        public void setSilentMode()
        Disables verbose mode (default silent mode).
      • getVerboseMode

        public boolean getVerboseMode()
        Returns verbose mode status.
        Returns:
        true if verbose mode is on, otherwise returns false.
      • enableImpliedMultiplicationMode

        public void enableImpliedMultiplicationMode()
        Sets implied multiplication
      • disableImpliedMultiplicationMode

        public void disableImpliedMultiplicationMode()
        Disables implied multiplication
      • checkIfImpliedMultiplicationMode

        public boolean checkIfImpliedMultiplicationMode()
        Gets implied multiplication status
        Returns:
        true if implied multiplication is enabled, otherwise returns false.
      • enableUnicodeBuiltinKeyWordsMode

        public void enableUnicodeBuiltinKeyWordsMode()
        Enables unicode built-in parser keywords, this flag informs the parser that built-in unicode keywords are supported and will be recognized as functions or operators.
      • disableUnicodeBuiltinKeyWordsMode

        public void disableUnicodeBuiltinKeyWordsMode()
        Disables unicode built-in parser keywords, this flag informs the parser that built-in unicode keywords are not supported and will not be recognized as functions or operators.
      • checkIfUnicodeBuiltinKeyWordsMode

        public boolean checkIfUnicodeBuiltinKeyWordsMode()
        Gets unicode built-in parser keywords mode
        Returns:
        true if unicode built-in parser keywords is enabled, otherwise returns false.
      • enableAttemptToFixExpStrMode

        public void enableAttemptToFixExpStrMode()
        Enables attempt to fix the expression String. For example, situations such as: "++" change to "+", "+-" changed to "-" "-+" changed to "-" "--" changed to "+"
      • disableAttemptToFixExpStrMode

        public void disableAttemptToFixExpStrMode()
        Disables attempt to fix the expression String. For example, situations such as: "++" change to "+", "+-" changed to "-" "-+" changed to "-" "--" changed ro "+"
      • checkIfAttemptToFixExpStrMode

        public boolean checkIfAttemptToFixExpStrMode()
        Gets attempt to fix expression string mode
        Returns:
        true attempt to fix expression string mode is enabled, otherwise returns false.
      • setRecursiveMode

        void setRecursiveMode()
        Sets recursive mode
      • disableRecursiveMode

        void disableRecursiveMode()
        Disables recursive mode
      • getRecursiveMode

        public boolean getRecursiveMode()
        Gets recursive mode status
        Returns:
        true if recursive mode is enabled, otherwise returns false.
      • setForwardErrorMessage

        void setForwardErrorMessage​(boolean forward)
        An indicator of whether an error message should be passed from the current expression to the expression that called it.
        Parameters:
        forward - If true then message is being forwarded.
      • getComputingTime

        public double getComputingTime()
        Gets computing time.
        Returns:
        computing time in seconds.
      • addDefinitions

        public void addDefinitions​(PrimitiveElement... elements)
        Adds user defined elements (such as: Arguments, Constants, Functions) to the expressions.
        Parameters:
        elements - Elements list (variadic), where Argument, Constant, Function extend the same class PrimitiveElement
        See Also:
        PrimitiveElement
      • removeDefinitions

        public void removeDefinitions​(PrimitiveElement... elements)
        Removes user defined elements (such as: Arguments, Constants, Functions) to the expressions.
        Parameters:
        elements - Elements list (variadic), where Argument, Constant, Function extend the same class PrimitiveElement
        See Also:
        PrimitiveElement
      • addArguments

        public void addArguments​(Argument... arguments)
        Adds arguments (variadic) to the expression definition.
        Parameters:
        arguments - the arguments list (comma separated list)
        See Also:
        Argument, RecursiveArgument
      • defineArguments

        public void defineArguments​(java.lang.String... argumentsNames)
        Enables to define the arguments (associated with the expression) based on the given arguments names.
        Parameters:
        argumentsNames - the arguments names (variadic) comma separated list
        See Also:
        Argument, RecursiveArgument
      • defineArgument

        public void defineArgument​(java.lang.String argumentName,
                                   double argumentValue)
        Enables to define the argument (associated with the expression) based on the argument name and the argument value.
        Parameters:
        argumentName - the argument name
        argumentValue - the argument value
        See Also:
        Argument, RecursiveArgument
      • getArgumentIndex

        public int getArgumentIndex​(java.lang.String argumentName)
        Gets argument index from the expression.
        Parameters:
        argumentName - the argument name
        Returns:
        The argument index if the argument name was found, otherwise returns Argument.NOT_FOUND
        See Also:
        Argument, RecursiveArgument
      • getArgument

        public Argument getArgument​(java.lang.String argumentName)
        Gets argument from the expression.
        Parameters:
        argumentName - the argument name
        Returns:
        The argument if the argument name was found, otherwise returns null.
        See Also:
        Argument, RecursiveArgument
      • getArgument

        public Argument getArgument​(int argumentIndex)
        Gets argument from the expression.
        Parameters:
        argumentIndex - the argument index
        Returns:
        Argument if the argument index is between 0 and the last available argument index (getArgumentsNumber()-1), otherwise returns null.
        See Also:
        Argument, RecursiveArgument
      • getArgumentsNumber

        public int getArgumentsNumber()
        Gets number of arguments associated with the expression.
        Returns:
        The number of arguments (int >= 0)
        See Also:
        Argument, RecursiveArgument
      • setArgumentValue

        public void setArgumentValue​(java.lang.String argumentName,
                                     double argumentValue)
        Sets argument value.
        Parameters:
        argumentName - the argument name
        argumentValue - the argument value
      • getArgumentValue

        public double getArgumentValue​(java.lang.String argumentName)
        Gets argument vale.
        Parameters:
        argumentName - the argument name
        Returns:
        Argument value if argument name was found, otherwise return Double.NaN.
      • removeArguments

        public void removeArguments​(java.lang.String... argumentsNames)
        Removes first occurrences of the arguments associated with the expression.
        Parameters:
        argumentsNames - the arguments names (variadic parameters) comma separated list
        See Also:
        Argument, RecursiveArgument
      • removeArguments

        public void removeArguments​(Argument... arguments)
        Removes first occurrences of the arguments associated with the expression.
        Parameters:
        arguments - the arguments (variadic parameters) comma separated list
        See Also:
        Argument, RecursiveArgument
      • removeAllArguments

        public void removeAllArguments()
        Removes all arguments associated with the expression.
        See Also:
        Argument, RecursiveArgument
      • addConstants

        public void addConstants​(Constant... constants)
        Adds constants (variadic parameters) to the expression definition.
        Parameters:
        constants - the constants (comma separated list)
        See Also:
        Constant
      • addConstants

        public void addConstants​(java.util.List<Constant> constantsList)
        Adds constants to the expression definition.
        Parameters:
        constantsList - the list of constants
        See Also:
        Constant
      • defineConstant

        public void defineConstant​(java.lang.String constantName,
                                   double constantValue)
        Enables to define the constant (associated with the expression) based on the constant name and constant value.
        Parameters:
        constantName - the constant name
        constantValue - the constant value
        See Also:
        Constant
      • getConstantIndex

        public int getConstantIndex​(java.lang.String constantName)
        Gets constant index associated with the expression.
        Parameters:
        constantName - the constant name
        Returns:
        Constant index if constant name was found, otherwise return Constant.NOT_FOUND.
        See Also:
        Constant
      • getConstant

        public Constant getConstant​(java.lang.String constantName)
        Gets constant associated with the expression.
        Parameters:
        constantName - the constant name
        Returns:
        Constant if constant name was found, otherwise return null.
        See Also:
        Constant
      • getConstant

        public Constant getConstant​(int constantIndex)
        Gets constant associated with the expression.
        Parameters:
        constantIndex - the constant index
        Returns:
        Constant if the constantIndex is between 0 and the last available constant index (getConstantsNumber() - 1), otherwise it returns null.
        See Also:
        Constant
      • getConstantsNumber

        public int getConstantsNumber()
        Gets number of constants associated with the expression.
        Returns:
        number of constants (int >= 0)
        See Also:
        Constant
      • removeConstants

        public void removeConstants​(java.lang.String... constantsNames)
        Removes first occurrences of the constants associated with the expression.
        Parameters:
        constantsNames - the constants names (variadic parameters) comma separated list
        See Also:
        Constant
      • removeConstants

        public void removeConstants​(Constant... constants)
        Removes first occurrences of the constants associated with the expression
        Parameters:
        constants - the constants (variadic parameters) comma separated list
        See Also:
        Constant
      • removeAllConstants

        public void removeAllConstants()
        Removes all constants associated with the expression
        See Also:
        Constant
      • addFunctions

        public void addFunctions​(Function... functions)
        Adds functions (variadic parameters) to the expression definition.
        Parameters:
        functions - the functions (variadic parameters) comma separated list
        See Also:
        Function
      • defineFunction

        public void defineFunction​(java.lang.String functionName,
                                   java.lang.String functionExpressionString,
                                   java.lang.String... argumentsNames)
        Enables to define the function (associated with the expression) based on the function name, function expression string and arguments names (variadic parameters).
        Parameters:
        functionName - the function name
        functionExpressionString - the expression string
        argumentsNames - the function arguments names (variadic parameters) comma separated list
        See Also:
        Function
      • getFunctionIndex

        public int getFunctionIndex​(java.lang.String functionName)
        Gets index of function associated with the expression.
        Parameters:
        functionName - the function name
        Returns:
        Function index if function name was found, otherwise returns Function.NOT_FOUND
        See Also:
        Function
      • getFunction

        public Function getFunction​(java.lang.String functionName)
        Gets function associated with the expression.
        Parameters:
        functionName - the function name
        Returns:
        Function if function name was found, otherwise returns null.
        See Also:
        Function
      • getFunction

        public Function getFunction​(int functionIndex)
        Gets function associated with the expression.
        Parameters:
        functionIndex - the function index
        Returns:
        Function if function index is between 0 and the last available function index (getFunctionsNumber()-1), otherwise returns null.
        See Also:
        Function
      • getFunctionsNumber

        public int getFunctionsNumber()
        Gets number of functions associated with the expression.
        Returns:
        number of functions (int >= 0)
        See Also:
        Function
      • removeFunctions

        public void removeFunctions​(java.lang.String... functionsNames)
        Removes first occurrences of the functions associated with the expression.
        Parameters:
        functionsNames - the functions names (variadic parameters) comma separated list
        See Also:
        Function
      • removeFunctions

        public void removeFunctions​(Function... functions)
        Removes first occurrences of the functions associated with the expression.
        Parameters:
        functions - the functions (variadic parameters) comma separated list.
        See Also:
        Function
      • removeAllFunctions

        public void removeAllFunctions()
        Removes all functions associated with the expression.
        See Also:
        Function
      • setToNumber

        private void setToNumber​(int pos,
                                 double number,
                                 boolean ulpRound)
        Sets given token to the number type / value. Method should be called only by the SetDecreaseRemove like methods
        Parameters:
        pos - the position on which token should be updated to the given number
        number - the number
        ulpRound - If true, then if mXparser.ulpRounding = true intelligent ULP rounding is applied.
      • setToNumber

        private void setToNumber​(int pos,
                                 double number)
      • f1SetDecreaseRemove

        private void f1SetDecreaseRemove​(int pos,
                                         double result,
                                         boolean ulpRound)
        SetDecreaseRemove for 1 arg functions SetDecreaseRemove like methods are called by the methods calculating values of the unary operation, binary relations and functions. 3 things are done by this type of methods 1) Set token type to number type / value 2) Decrease level of the token 3) Remove no longer needed tokens For example: Expression string: 1+cos(0) will be tokened as follows: idx : 0 1 2 3 4 5 token : 1 + cos ( 0 ) level : 0 0 1 2 2 2 Partitions with the highest level will be handled first. In the case presented above, it means, that the parenthesis will be removed idx : 0 1 2 3 token : 1 + cos 0 level : 0 0 1 2 Next step is to calculate cos(0) = 1 SetDecreaseRemove like methods 1) Set cos token to 1 (pos=2, result=1): idx : 0 1 2 3 token : 1 + 1 0 level : 0 0 1 2 2) Decrease level (pos=2): idx : 0 1 2 3 token : 1 + 1 0 level : 0 0 0 2 3) Remove no longer needed tokens (pos+1=3): idx : 0 1 2 token : 1 + 1 level : 0 0 0
        Parameters:
        pos - the position on which token should be updated to the given number
        result - the number
        ulpRound - If true, then if mXparser.ulpRounding = true intelligent ULP rounding is applied.
      • f1SetDecreaseRemove

        private void f1SetDecreaseRemove​(int pos,
                                         double result)
      • f2SetDecreaseRemove

        private void f2SetDecreaseRemove​(int pos,
                                         double result,
                                         boolean ulpRound)
        SetDecreaseRemove for 2-args functions For detailed specification refer to the f1SetDecreaseRemove()
        Parameters:
        pos - the position on which token should be updated to the given number
        result - the number
        ulpRound - If true, then if mXparser.ulpRounding = true intelligent ULP rounding is applied.
      • f2SetDecreaseRemove

        private void f2SetDecreaseRemove​(int pos,
                                         double result)
      • f3SetDecreaseRemove

        private void f3SetDecreaseRemove​(int pos,
                                         double result,
                                         boolean ulpRound)
        SetDecreaseRemove for 3-args functions For detailed specification refer to the f1SetDecreaseRemove()
        Parameters:
        pos - the position on which token should be updated to the given number
        result - the number
        ulpRound - If true, then if mXparser.ulpRounding = true intelligent ULP rounding is applied.
      • f3SetDecreaseRemove

        private void f3SetDecreaseRemove​(int pos,
                                         double result)
      • opSetDecreaseRemove

        private void opSetDecreaseRemove​(int pos,
                                         double result,
                                         boolean ulpRound)
        SetDecreaseRemove for operators For detailed specification refer to the f1SetDecreaseRemove()
        Parameters:
        pos - the position on which token should be updated to the given number
        result - the number
        ulpRound - If true, then if mXparser.ulpRounding = true intelligent ULP rounding is applied.
      • opSetDecreaseRemove

        private void opSetDecreaseRemove​(int pos,
                                         double result)
      • calcSetDecreaseRemove

        private void calcSetDecreaseRemove​(int pos,
                                           double result,
                                           boolean ulpRound)
        SetDecreaseRemove for calculus operators. For detailed specification refer to the f1SetDecreaseRemove()
        Parameters:
        pos - the position on which token should be updated to the given number
        result - the number
        ulpRound - If true, then if mXparser.ulpRounding = true intelligent ULP rounding is applied.
      • calcSetDecreaseRemove

        private void calcSetDecreaseRemove​(int pos,
                                           double result)
      • variadicSetDecreaseRemove

        private void variadicSetDecreaseRemove​(int pos,
                                               double value,
                                               int length,
                                               boolean ulpRound)
        SetDecreaseRemove for special functions. For detailed specification refer to the f1SetDecreaseRemove()
        Parameters:
        pos - the position on which token should be updated to the given number
        value - the number
        length - the special function range
        ulpRound - If true, then if mXparser.ulpRounding = true intelligent ULP rounding is applied.
      • variadicSetDecreaseRemove

        private void variadicSetDecreaseRemove​(int pos,
                                               double value,
                                               int length)
      • ifSetRemove

        private void ifSetRemove​(int pos,
                                 double ifCondition,
                                 boolean ulpRound)
        If set remove method for the if function.
        Parameters:
        pos - the position
        ifCondition - the result of if condition
        ulpRound - If true, then if mXparser.ulpRounding = true intelligent ULP rounding is applied.
      • removeTokens

        private void removeTokens​(int from,
                                  int to)
      • ifSetRemove

        private void ifSetRemove​(int pos,
                                 double ifCondition)
      • createInitialTokens

        private static java.util.List<Token> createInitialTokens​(int startPos,
                                                                 int endPos,
                                                                 java.util.List<Token> tokensList)
        Creates string tokens list from the subexpression.
        Parameters:
        startPos - start position (index)
        endPos - end position (index)
        Returns:
        tokens list representing requested subexpression.
      • getParametersNumber

        private int getParametersNumber​(int pos)
        Return number of functions parameters.
        Parameters:
        pos - the function position
      • getParamArgument

        private ArgumentParameter getParamArgument​(java.lang.String argumentName)
        Gets / returns argument representing given argument name. If argument name exists on the list of known arguments the initial status of the found argument is remembered, otherwise new argument will be created.
        Parameters:
        argumentName - the argument name
        Returns:
        Argument parameter representing given argument name:
        See Also:
        ArgumentParameter, Argument
      • clearParamArgument

        private void clearParamArgument​(ArgumentParameter argParam)
        Clears argument parameter.
        Parameters:
        argParam - the argument parameter.
      • FREE_ARGUMENT

        private void FREE_ARGUMENT​(int pos)
        Free Arguments handling.
        Parameters:
        pos - the token position
      • DEPENDENT_ARGUMENT

        private void DEPENDENT_ARGUMENT​(int pos,
                                        CalcStepsRegister calcStepsRegister)
        Dependent Arguments handling.
        Parameters:
        pos - the token position
      • USER_FUNCTION

        private void USER_FUNCTION​(int pos,
                                   CalcStepsRegister calcStepsRegister)
        User functions handling.
        Parameters:
        pos - the token position
      • USER_CONSTANT

        private void USER_CONSTANT​(int pos)
        User constants handling.
        Parameters:
        pos - the token position
      • RECURSIVE_ARGUMENT

        private void RECURSIVE_ARGUMENT​(int pos)
        Recursive arguments handling.
        Parameters:
        pos - the token position
      • CONSTANT

        private void CONSTANT​(int pos)
        Constants handling.
        Parameters:
        pos - the token position
      • UNIT

        private void UNIT​(int pos)
        Constants handling.
        Parameters:
        pos - the token position
      • RANDOM_VARIABLE

        private void RANDOM_VARIABLE​(int pos)
        Random Variables handling.
        Parameters:
        pos - the token position
      • getTokenValue

        private double getTokenValue​(int tokenIndex)
        Gets token value
        Parameters:
        tokenIndex - the token index
        Returns:
        the token value
      • TETRATION

        private void TETRATION​(int pos)
        Tetration handling.
        Parameters:
        pos - the token position
      • POWER

        private void POWER​(int pos)
        Power handling.
        Parameters:
        pos - the token position
      • MODULO

        private void MODULO​(int pos)
        Modulo handling.
        Parameters:
        pos - the token position
      • DIVIDE

        private void DIVIDE​(int pos)
        Division handling.
        Parameters:
        pos - the token position
      • DIVIDE_QUOTIENT

        private void DIVIDE_QUOTIENT​(int pos)
        Integer division handling.
        Parameters:
        pos - the token position
      • MULTIPLY

        private void MULTIPLY​(int pos)
        Multiplication handling.
        Parameters:
        pos - the token position
      • PLUS

        private void PLUS​(int pos)
        Addition handling.
        Parameters:
        pos - the token position
      • MINUS

        private void MINUS​(int pos)
        Subtraction handling
        Parameters:
        pos - the token position
      • AND

        private void AND​(int pos)
        Logical AND
        Parameters:
        pos - the token position
      • OR

        private void OR​(int pos)
        Logical OR
        Parameters:
        pos - the token position
      • NAND

        private void NAND​(int pos)
        Logical NAND
        Parameters:
        pos - the token position
      • NOR

        private void NOR​(int pos)
        Logical NOR
        Parameters:
        pos - the token position
      • XOR

        private void XOR​(int pos)
        Logical XOR
        Parameters:
        pos - the token position
      • IMP

        private void IMP​(int pos)
        Logical IMP
        Parameters:
        pos - the token position
      • CIMP

        private void CIMP​(int pos)
        Logical CIMP
        Parameters:
        pos - the token position
      • NIMP

        private void NIMP​(int pos)
        Logical NIMP
        Parameters:
        pos - the token position
      • CNIMP

        private void CNIMP​(int pos)
        Logical CNIMP
        Parameters:
        pos - the token position
      • EQV

        private void EQV​(int pos)
        Logical EQV
        Parameters:
        pos - the token position
      • NEG

        private void NEG​(int pos)
        Logical negation
        Parameters:
        pos - the token position
      • EQ

        private void EQ​(int pos)
        Equality relation.
        Parameters:
        pos - the token position
      • NEQ

        private void NEQ​(int pos)
        Not equals.
        Parameters:
        pos - the token position
      • LT

        private void LT​(int pos)
        Lower than.
        Parameters:
        pos - the token position
      • GT

        private void GT​(int pos)
        Greater than.
        Parameters:
        pos - the token position
      • LEQ

        private void LEQ​(int pos)
        Lower or equal.
        Parameters:
        pos - the token position
      • GEQ

        private void GEQ​(int pos)
        Greater or equal
        Parameters:
        pos - the token position
      • SQUARE_ROOT_OPERATOR

        private void SQUARE_ROOT_OPERATOR​(int pos)
        Square root as unary left operator
        Parameters:
        pos - the token position
      • CUBE_ROOT_OPERATOR

        private void CUBE_ROOT_OPERATOR​(int pos)
        Cube root as unary left operator
        Parameters:
        pos - the token position
      • FOURTH_ROOT_OPERATOR

        private void FOURTH_ROOT_OPERATOR​(int pos)
        Fourth root as unary left operator
        Parameters:
        pos - the token position
      • BITWISE_COMPL

        private void BITWISE_COMPL​(int pos)
        Bitwise COMPL
        Parameters:
        pos - the token position
      • BITWISE_AND

        private void BITWISE_AND​(int pos)
        Bitwise AND
        Parameters:
        pos - the token position
      • BITWISE_OR

        private void BITWISE_OR​(int pos)
        Bitwise OR
        Parameters:
        pos - the token position
      • BITWISE_XOR

        private void BITWISE_XOR​(int pos)
        Bitwise XOR
        Parameters:
        pos - the token position
      • BITWISE_NAND

        private void BITWISE_NAND​(int pos)
        Bitwise NAND
        Parameters:
        pos - the token position
      • BITWISE_NOR

        private void BITWISE_NOR​(int pos)
        Bitwise NOR
        Parameters:
        pos - the token position
      • BITWISE_XNOR

        private void BITWISE_XNOR​(int pos)
        Bitwise NOR
        Parameters:
        pos - the token position
      • BITWISE_LEFT_SHIFT

        private void BITWISE_LEFT_SHIFT​(int pos)
        Bitwise LEFT SHIFT
        Parameters:
        pos - the token position
      • BITWISE_RIGHT_SHIFT

        private void BITWISE_RIGHT_SHIFT​(int pos)
        Bitwise RIGHT SHIFT
        Parameters:
        pos - the token position
      • SIN

        private void SIN​(int pos)
        Sine function
        Parameters:
        pos - the token position
      • COS

        private void COS​(int pos)
        Cosine / Trigonometric functions Sets tokens to number token
        Parameters:
        pos - the token position
      • TAN

        private void TAN​(int pos)
        Tangent / Trigonometric functions Sets tokens to number token
        Parameters:
        pos - the token position
      • CTAN

        private void CTAN​(int pos)
        Cotangent / Trigonometric functions Sets tokens to number token
        Parameters:
        pos - the token position
      • SEC

        private void SEC​(int pos)
        Secant / Trigonometric functions Sets tokens to number token
        Parameters:
        pos - the token position
      • COSEC

        private void COSEC​(int pos)
        Cosecant / Trigonometric functions Sets tokens to number token
        Parameters:
        pos - the token position
      • ASIN

        private void ASIN​(int pos)
        Arcus sine / Inverse trigonometric functions Sets tokens to number token
        Parameters:
        pos - the token position
      • ACOS

        private void ACOS​(int pos)
        Arcus cosine / Inverse trigonometric functions Sets tokens to number token
        Parameters:
        pos - the token position
      • ATAN

        private void ATAN​(int pos)
        Arcus tangent / Inverse trigonometric functions Sets tokens to number token
        Parameters:
        pos - the token position
      • ACTAN

        private void ACTAN​(int pos)
        Arcus cotangent / Inverse trigonometric functions Sets tokens to number token
        Parameters:
        pos - the token position
      • LN

        private void LN​(int pos)
        Natural logarithm (base e) Sets tokens to number token
        Parameters:
        pos - the token position
      • LOG2

        private void LOG2​(int pos)
        Logarithm - base 2 Sets tokens to number token
        Parameters:
        pos - the token position
      • LOG10

        private void LOG10​(int pos)
        Logarithm - base 10 Sets tokens to number token
        Parameters:
        pos - the token position
      • RAD

        private void RAD​(int pos)
        Converts degrees to radius Sets tokens to number token
        Parameters:
        pos - the token position
      • EXP

        private void EXP​(int pos)
        Exponential function Sets tokens to number token
        Parameters:
        pos - the token position
      • SQRT

        private void SQRT​(int pos)
        Square root Sets tokens to number token
        Parameters:
        pos - the token position
      • SINH

        private void SINH​(int pos)
        Hyperbolic sine Sets tokens to number token
        Parameters:
        pos - the token position
      • COSH

        private void COSH​(int pos)
        Hyperbolic cosine Sets tokens to number token
        Parameters:
        pos - the token position
      • TANH

        private void TANH​(int pos)
        Hyperbolic tangent Sets tokens to number token
        Parameters:
        pos - the token position
      • COTH

        private void COTH​(int pos)
        Hyperbolic cotangent Sets tokens to number token
        Parameters:
        pos - the token position
      • SECH

        private void SECH​(int pos)
        Hyperbolic secant Sets tokens to number token
        Parameters:
        pos - the token position
      • CSCH

        private void CSCH​(int pos)
        Hyperbolic cosecant Sets tokens to number token
        Parameters:
        pos - the token position
      • DEG

        private void DEG​(int pos)
        Converts radians to degrees Sets tokens to number token
        Parameters:
        pos - the token position
      • ABS

        private void ABS​(int pos)
        Absolut value Sets tokens to number token
        Parameters:
        pos - the token position
      • SGN

        private void SGN​(int pos)
        Signum function Sets tokens to number token
        Parameters:
        pos - the token position
      • FLOOR

        private void FLOOR​(int pos)
        Floor function Sets tokens to number token
        Parameters:
        pos - the token position
      • CEIL

        private void CEIL​(int pos)
        Ceil function Sets tokens to number token
        Parameters:
        pos - the token position
      • ARSINH

        private void ARSINH​(int pos)
        Arcus hyperbolic sine Sets tokens to number token
        Parameters:
        pos - the token position
      • ARCOSH

        private void ARCOSH​(int pos)
        Arcus hyperbolic cosine Sets tokens to number token
        Parameters:
        pos - the token position
      • ARTANH

        private void ARTANH​(int pos)
        Arcus hyperbolic tangent Sets tokens to number token
        Parameters:
        pos - the token position
      • ARCOTH

        private void ARCOTH​(int pos)
        Arcus hyperbolic cotangent Sets tokens to number token
        Parameters:
        pos - the token position
      • ARSECH

        private void ARSECH​(int pos)
        Arcus hyperbolic secant Sets tokens to number token
        Parameters:
        pos - the token position
      • ARCSCH

        private void ARCSCH​(int pos)
        Arcus hyperbolic cosecant Sets tokens to number token
        Parameters:
        pos - the token position
      • SA

        private void SA​(int pos)
        SA / sinc normalized
        Parameters:
        pos - the token position
      • SINC

        private void SINC​(int pos)
        Sinc unnormalized
        Parameters:
        pos - the token position
      • BELL_NUMBER

        private void BELL_NUMBER​(int pos)
        Bell numbers
        Parameters:
        pos - the token position
      • LUCAS_NUMBER

        private void LUCAS_NUMBER​(int pos)
        Lucas numbers
        Parameters:
        pos - the token position
      • FIBONACCI_NUMBER

        private void FIBONACCI_NUMBER​(int pos)
        Fibonacci numbers
        Parameters:
        pos - the token position
      • HARMONIC_NUMBER

        private void HARMONIC_NUMBER​(int pos)
        Harmonic numbers
        Parameters:
        pos - the token position
      • IS_PRIME

        private void IS_PRIME​(int pos)
        Prime test
        Parameters:
        pos - the token position
      • PRIME_COUNT

        private void PRIME_COUNT​(int pos)
        Prime counting
        Parameters:
        pos - the token position
      • EXP_INT

        private void EXP_INT​(int pos)
        Exponential integral function
        Parameters:
        pos - the token position
      • LOG_INT

        private void LOG_INT​(int pos)
        Logarithmic exponential integral function
        Parameters:
        pos - the token position
      • OFF_LOG_INT

        private void OFF_LOG_INT​(int pos)
        Offset logarithmic exponential integral function
        Parameters:
        pos - the token position
      • FACT

        private void FACT​(int pos)
        Factorilal function Sets tokens to number token
        Parameters:
        pos - the token position
      • PERC

        private void PERC​(int pos)
        Percentage Sets tokens to number token
        Parameters:
        pos - the token position
      • NOT

        private void NOT​(int pos)
        Negation Sets tokens to number token
        Parameters:
        pos - the token position
      • GAUSS_ERF

        private void GAUSS_ERF​(int pos)
        Gauss error function
        Parameters:
        pos - the token position
      • GAUSS_ERFC

        private void GAUSS_ERFC​(int pos)
        Gauss complementary error function
        Parameters:
        pos - the token position
      • GAUSS_ERF_INV

        private void GAUSS_ERF_INV​(int pos)
        Inverse of Gauss error function
        Parameters:
        pos - the token position
      • GAUSS_ERFC_INV

        private void GAUSS_ERFC_INV​(int pos)
        Inverse of Gauss complementary error function
        Parameters:
        pos - the token position
      • ULP

        private void ULP​(int pos)
        Unit in The Last Place Sets tokens to number token
        Parameters:
        pos - the token position
      • ISNAN

        private void ISNAN​(int pos)
        Is Not-a-Number Sets tokens to number token
        Parameters:
        pos - the token position
      • NDIG10

        private void NDIG10​(int pos)
        Number of digits in base 10 Sets tokens to number token
        Parameters:
        pos - the token position
      • NFACT

        private void NFACT​(int pos)
        Number of prime factors - distinct Sets tokens to number token
        Parameters:
        pos - the token position
      • ARCSEC

        private void ARCSEC​(int pos)
        Arcuus secant Sets tokens to number token
        Parameters:
        pos - the token position
      • ARCCSC

        private void ARCCSC​(int pos)
        Arcuus cosecant Sets tokens to number token
        Parameters:
        pos - the token position
      • GAMMA

        private void GAMMA​(int pos)
        Gamma special function Sets tokens to number token
        Parameters:
        pos - the token position
      • LAMBERT_W0

        private void LAMBERT_W0​(int pos)
        Lambert-W special function, principal branch 0 Sets tokens to number token
        Parameters:
        pos - the token position
      • LAMBERT_W1

        private void LAMBERT_W1​(int pos)
        Lambert-W special function, branch = -1 Sets tokens to number token
        Parameters:
        pos - the token position
      • SGN_GAMMA

        private void SGN_GAMMA​(int pos)
        Signum of Gamma special function Sets tokens to number token
        Parameters:
        pos - the token position
      • LOG_GAMMA

        private void LOG_GAMMA​(int pos)
        Log Gamma special function Sets tokens to number token
        Parameters:
        pos - the token position
      • DI_GAMMA

        private void DI_GAMMA​(int pos)
        Digamma special function Sets tokens to number token
        Parameters:
        pos - the token position
      • UDF_PARAM

        private void UDF_PARAM​(int pos)
        User Defined Variadic function param value Sets tokens to number token
        Parameters:
        pos - the token position
      • RND_STUDENT_T

        private void RND_STUDENT_T​(int pos)
      • RND_CHI2

        private void RND_CHI2​(int pos)
      • LOG

        private void LOG​(int pos)
        Logarithm Sets tokens to number token
        Parameters:
        pos - the token position
      • getNumbers

        private java.util.List<java.lang.Double> getNumbers​(int pos)
        Creates ArraList containing function parameters
        Parameters:
        pos - the function position
        Returns:
        List of function parameters.
      • MOD

        private void MOD​(int pos)
        Modulo Sets tokens to number token
        Parameters:
        pos - the token position
      • BINOM_COEFF

        private void BINOM_COEFF​(int pos)
        Binomial Coefficient
        Parameters:
        pos - the token position
      • PERMUTATIONS

        private void PERMUTATIONS​(int pos)
        Number of permutations
        Parameters:
        pos - the token position
      • BETA

        private void BETA​(int pos)
        Beta special function
        Parameters:
        pos - the token position
      • LOG_BETA

        private void LOG_BETA​(int pos)
        Log beta special function
        Parameters:
        pos - the token position
      • PDF_STUDENT_T

        private void PDF_STUDENT_T​(int pos)
      • CDF_STUDENT_T

        private void CDF_STUDENT_T​(int pos)
      • QNT_STUDENT_T

        private void QNT_STUDENT_T​(int pos)
      • PDF_CHI2

        private void PDF_CHI2​(int pos)
      • CDF_CHI2

        private void CDF_CHI2​(int pos)
      • QNT_CHI2

        private void QNT_CHI2​(int pos)
      • BERNOULLI_NUMBER

        private void BERNOULLI_NUMBER​(int pos)
        Bernoulli Number
        Parameters:
        pos - the token position
      • STIRLING1_NUMBER

        private void STIRLING1_NUMBER​(int pos)
        Stirling number of the first kind
        Parameters:
        pos - the token position
      • STIRLING2_NUMBER

        private void STIRLING2_NUMBER​(int pos)
        Stirling number of the second kind.
        Parameters:
        pos - the token position
      • WORPITZKY_NUMBER

        private void WORPITZKY_NUMBER​(int pos)
        Worpitzky number.
        Parameters:
        pos - the token position
      • EULER_NUMBER

        private void EULER_NUMBER​(int pos)
        Euler number
        Parameters:
        pos - the token position
      • KRONECKER_DELTA

        private void KRONECKER_DELTA​(int pos)
        Kronecker delta
        Parameters:
        pos - the token position
      • EULER_POLYNOMIAL

        private void EULER_POLYNOMIAL​(int pos)
        Euler polynomial
        Parameters:
        pos - the token position
      • HARMONIC2_NUMBER

        private void HARMONIC2_NUMBER​(int pos)
        Harmonic numbers
        Parameters:
        pos - the token position
      • ROUND

        private void ROUND​(int pos)
        Decimal rounding
        Parameters:
        pos - the token position
      • RND_VAR_UNIFORM_CONT

        private void RND_VAR_UNIFORM_CONT​(int pos)
        Random number - Uniform Continuous distribution
        Parameters:
        pos - the token position
      • RND_VAR_UNIFORM_DISCR

        private void RND_VAR_UNIFORM_DISCR​(int pos)
        Random number - Uniform Discrete distribution
        Parameters:
        pos - the token position
      • RND_NORMAL

        private void RND_NORMAL​(int pos)
        Random number - Normal distribution
        Parameters:
        pos - the token position
      • RND_F_SNEDECOR

        private void RND_F_SNEDECOR​(int pos)
        Random number - Snedecor's F distribution (F-distribution or F-ratio, also known as Fisher–Snedecor distribution)
        Parameters:
        pos - the token position
      • NDIG

        private void NDIG​(int pos)
        Number of digits in given numeral system
        Parameters:
        pos - the token position
      • DIGIT10

        private void DIGIT10​(int pos)
        Digit at position - base 10 numeral system
        Parameters:
        pos - the token position
      • FACTVAL

        private void FACTVAL​(int pos)
        Prime factor value
        Parameters:
        pos - the token position
      • FACTEXP

        private void FACTEXP​(int pos)
        Prime factor value exponent
        Parameters:
        pos - the token position
      • ROOT

        private void ROOT​(int pos)
        Nth order root
        Parameters:
        pos - the token position
      • INC_GAMMA_LOWER

        private void INC_GAMMA_LOWER​(int pos)
        Lower incomplete special Gamma function
        Parameters:
        pos - the token position
      • INC_GAMMA_UPPER

        private void INC_GAMMA_UPPER​(int pos)
        Upper incomplete special Gamma function
        Parameters:
        pos - the token position
      • REG_GAMMA_LOWER

        private void REG_GAMMA_LOWER​(int pos)
        Lower regularized special Gamma function
        Parameters:
        pos - the token position
      • REG_GAMMA_UPPER

        private void REG_GAMMA_UPPER​(int pos)
        Lower regularized special Gamma function
        Parameters:
        pos - the token position
      • IF_CONDITION

        private void IF_CONDITION​(int pos)
        IF function
        Parameters:
        pos - the token position
      • IFF

        private void IFF​(int pos)
        IFF function
        Parameters:
        pos - the token position
      • IF

        private void IF​(int pos)
        IF Sets tokens to number token
        Parameters:
        pos - token index (position)
      • CHI

        private void CHI​(int pos)
        Characteristic function (a,b)
        Parameters:
        pos - the token position
      • CHI_LR

        private void CHI_LR​(int pos)
        Characteristic function [a,b]
        Parameters:
        pos - the token position
      • CHI_L

        private void CHI_L​(int pos)
        Characteristic function [a,b)
        Parameters:
        pos - the token position
      • CHI_R

        private void CHI_R​(int pos)
        Characteristic function (a,b]
        Parameters:
        pos - the token position
      • PDF_UNIFORM_CONT

        private void PDF_UNIFORM_CONT​(int pos)
        Probability Distribution Function - Uniform Continuous distribution
        Parameters:
        pos - the token position
      • CDF_UNIFORM_CONT

        private void CDF_UNIFORM_CONT​(int pos)
        Cumulative Distribution Function - Uniform Continuous distribution
        Parameters:
        pos - the token position
      • QNT_UNIFORM_CONT

        private void QNT_UNIFORM_CONT​(int pos)
        Quantile Function - Uniform Continuous distribution
        Parameters:
        pos - the token position
      • PDF_NORMAL

        private void PDF_NORMAL​(int pos)
        Probability Distribution Function - Normal distribution
        Parameters:
        pos - the token position
      • CDF_NORMAL

        private void CDF_NORMAL​(int pos)
        Cumulative Distribution Function - Normal distribution
        Parameters:
        pos - the token position
      • QNT_NORMAL

        private void QNT_NORMAL​(int pos)
        Quantile Function - Normal distribution
        Parameters:
        pos - the token position
      • PDF_F_SNEDECOR

        private void PDF_F_SNEDECOR​(int pos)
        Probability Distribution Function - Snedecor's F distribution
        Parameters:
        pos - the token position
      • CDF_F_SNEDECOR

        private void CDF_F_SNEDECOR​(int pos)
        Cumulative Distribution Function - Snedecor's F distribution
        Parameters:
        pos - the token position
      • QNT_F_SNEDECOR

        private void QNT_F_SNEDECOR​(int pos)
        Quantile Function - Snedecor's F distribution
        Parameters:
        pos - the token position
      • DIGIT

        private void DIGIT​(int pos)
        Digit at position - numeral system with given base
        Parameters:
        pos - the token position
      • INC_BETA

        private void INC_BETA​(int pos)
        Incomplete beta special function
        Parameters:
        pos - the token position
      • REG_BETA

        private void REG_BETA​(int pos)
        Regularized incomplete beta special function
        Parameters:
        pos - the token position
      • updateMissingTokens

        private static void updateMissingTokens​(java.util.List<Token> tokens,
                                                java.lang.String keyWord,
                                                int tokenId,
                                                int tokenTypeId)
        Updating missing tokens (i.e. indexes i sum operator). Used when creating internal expressions based on the sublist of tokens.
        Parameters:
        tokens - the tokens list
        keyWord - missing keyword
        tokenId - missing token id
        tokenTypeId - missing token type id
      • updateMissingTokens

        private static void updateMissingTokens​(ArgumentParameter index,
                                                IterativeOperatorParameters iterParams)
        Update missing tokens in expression related to iterative operators.
        Parameters:
        index - Index parameter of the iterative operator
        iterParams - Parameters list of the iterative operator
      • evalFromToDeltaParameters

        private void evalFromToDeltaParameters​(ArgumentParameter index,
                                               IterativeOperatorParameters iterParams)
        Evaluates ranges 'from', 'to', 'delta' for the iterative operator
        Parameters:
        index - Index parameter of the iterative operator
        iterParams - Parameters list of the iterative operator
      • SUM

        private void SUM​(int pos)
        Summation operator (SIGMA by) sum(i,m,n,f(i),b) --> sum f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
        Parameters:
        pos - the token position
      • PROD

        private void PROD​(int pos)
        Product operator (SIGMA by) pord(i,m,n,f(i),b) --> prod f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
        Parameters:
        pos - the token position
      • MIN

        private void MIN​(int pos)
        Minimum value - iterative operator mini(i,m,n,f(i),b) --> min f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
        Parameters:
        pos - the token position
      • MAX

        private void MAX​(int pos)
        Maximum value - iterative operator maxi(i,m,n,f(i),b) --> max f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
        Parameters:
        pos - the token position
      • AVG

        private void AVG​(int pos)
        Average function value - iterative operator avg(i,m,n,f(i),b) --> avg f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
        Parameters:
        pos - the token position
      • VAR

        private void VAR​(int pos)
        Variance from sample function values - iterative operator vari(i,m,n,f(i),b) --> var f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
        Parameters:
        pos - the token position
      • STD

        private void STD​(int pos)
        Standard deviation from sample function values - iterative operator stdi(i,m,n,f(i),b) --> std f(i) from i=m to i=n by delta i - index (argument) m, n - numbers or expressions f(i) - function string by delta
        Parameters:
        pos - the token position
      • DERIVATIVE

        private void DERIVATIVE​(int pos,
                                int derivativeType)
        Function derivative
        Parameters:
        pos - the token position
        derivativeType - the type of derivative (LEFT, RIGHT, ...)
      • DERIVATIVE_NTH

        private void DERIVATIVE_NTH​(int pos,
                                    int derivativeType)
        Function derivative
        Parameters:
        pos - the token position
        derivativeType - the type of derivative (left, right, etc...)
      • INTEGRAL

        private void INTEGRAL​(int pos)
        Function integral
        Parameters:
        pos - the token position
      • SOLVE

        private void SOLVE​(int pos)
        Function SOLVE
        Parameters:
        pos - the token position
      • FORWARD_DIFFERENCE

        private void FORWARD_DIFFERENCE​(int pos)
        Forward difference operator
        Parameters:
        pos - the token position
      • BACKWARD_DIFFERENCE

        private void BACKWARD_DIFFERENCE​(int pos)
        Backward diffrence operator
        Parameters:
        pos - the token position
      • MIN_VARIADIC

        private void MIN_VARIADIC​(int pos)
        Minimum variadic Sets tokens to number token
        Parameters:
        pos - the token position
      • MAX_VARIADIC

        private void MAX_VARIADIC​(int pos)
        Maximum variadic Sets tokens to number token
        Parameters:
        pos - token index (position)
      • SUM_VARIADIC

        private void SUM_VARIADIC​(int pos)
        Sum variadic Sets tokens to number token
        Parameters:
        pos - token index (position)
      • PROD_VARIADIC

        private void PROD_VARIADIC​(int pos)
        Sum variadic Sets tokens to number token
        Parameters:
        pos - token index (position)
      • AVG_VARIADIC

        private void AVG_VARIADIC​(int pos)
        Average variadic Sets tokens to number token
        Parameters:
        pos - token index (position)
      • VAR_VARIADIC

        private void VAR_VARIADIC​(int pos)
        Variance variadic Sets tokens to number token
        Parameters:
        pos - token index (position)
      • STD_VARIADIC

        private void STD_VARIADIC​(int pos)
        Standard deviation variadic Sets tokens to number token
        Parameters:
        pos - token index (position)
      • CONTINUED_FRACTION

        private void CONTINUED_FRACTION​(int pos)
        Continued fraction
        Parameters:
        pos - the token position
      • CONTINUED_POLYNOMIAL

        private void CONTINUED_POLYNOMIAL​(int pos)
        Continued polynomial
        Parameters:
        pos - the token position
      • GCD

        private void GCD​(int pos)
        Greates Common Divisor
        Parameters:
        pos - the token position
      • LCM

        private void LCM​(int pos)
        Lowest Common Multiply
        Parameters:
        pos - the token position
      • RND_LIST

        private void RND_LIST​(int pos)
        Random number from list
        Parameters:
        pos - the token position
      • COALESCE

        private void COALESCE​(int pos)
        Coalesce
        Parameters:
        pos - the token position
      • OR_VARIADIC

        private void OR_VARIADIC​(int pos)
        OR_VARIADIC
        Parameters:
        pos - the token position
      • AND_VARIADIC

        private void AND_VARIADIC​(int pos)
        AND_VARIADIC
        Parameters:
        pos - the token position
      • XOR_VARIADIC

        private void XOR_VARIADIC​(int pos)
        XOR_VARIADIC
        Parameters:
        pos - the token position
      • ARGMIN_VARIADIC

        private void ARGMIN_VARIADIC​(int pos)
        ARGMIN_VARIADIC
        Parameters:
        pos - the token position
      • ARGMAX_VARIADIC

        private void ARGMAX_VARIADIC​(int pos)
        ARGMAX_VARIADIC
        Parameters:
        pos - the token position
      • MEDIAN_VARIADIC

        private void MEDIAN_VARIADIC​(int pos)
        MEDIAN_VARIADIC
        Parameters:
        pos - the token position
      • MODE_VARIADIC

        private void MODE_VARIADIC​(int pos)
        MODE_VARIADIC
        Parameters:
        pos - the token position
      • BASE_VARIADIC

        private void BASE_VARIADIC​(int pos)
        BASE_VARIADIC
        Parameters:
        pos - the token position
      • NDIST_VARIADIC

        private void NDIST_VARIADIC​(int pos)
        NDIST_VARIADIC
        Parameters:
        pos - the token position
      • COMMA

        private void COMMA​(int pos)
        Parser symbols Removes comma
        Parameters:
        pos - token index (position)
      • PARENTHESES

        private void PARENTHESES​(int lPos,
                                 int rPos)
        Parser symbols Removes parenthesis
        Parameters:
        lPos - left token index (position)
        rPos - roght token index (position)
      • checkLexSyntax

        public boolean checkLexSyntax()
        Checks syntax of the expression string.
        Returns:
        true if syntax is ok
      • cleanExpressionString

        private void cleanExpressionString()
        Cleans blanks and other cases like "++', "+-", "-+"", "--"
      • checkSyntax

        public boolean checkSyntax()
        Checks syntax of the expression string.
        Returns:
        true if syntax is ok
      • checkCalculusParameter

        private int checkCalculusParameter​(java.lang.String param)
        Checks syntax of the calculus parameter
        Returns:
        true if syntax is ok
      • checkIfKnownArgument

        private static boolean checkIfKnownArgument​(FunctionParameter param)
        Checks if argument given in the function parameter is known in the expression.
        Parameters:
        param - the function parameter
        Returns:
        true if argument is known, otherwise returns false.
      • checkIfUnknownToken

        private static boolean checkIfUnknownToken​(FunctionParameter param)
        Checks if token is uknown
        Parameters:
        param - the function parameter
        Returns:
        true if there is only 1 token with unknown type, otherwise returns false.
      • syntaxIsAlreadyCheckedNorErrors

        private boolean syntaxIsAlreadyCheckedNorErrors()
      • registerFinalSyntaxAlreadyCheckedNorErrors

        private void registerFinalSyntaxAlreadyCheckedNorErrors​(java.lang.String recursionInfoLevel)
      • registerFinalSyntaxFunctionWithBodyExtNoErrors

        private void registerFinalSyntaxFunctionWithBodyExtNoErrors​(java.lang.String recursionInfoLevel)
      • registerFinalSyntaxExpressionStringIsEmpty

        private void registerFinalSyntaxExpressionStringIsEmpty​(java.lang.String recursionInfoLevel)
      • registerSyntaxLexicalError

        private void registerSyntaxLexicalError​(java.lang.String recursionInfoLevel,
                                                java.lang.Throwable e)
      • registerFinalSyntax

        private void registerFinalSyntax​(java.lang.String recursionInfoLevel,
                                         boolean syntax)
      • registerPartialSyntaxStartingSyntaxCheck

        private void registerPartialSyntaxStartingSyntaxCheck​(java.lang.String recursionInfoLevel)
      • checkPartialSyntaxImpliedMultiplication

        private boolean checkPartialSyntaxImpliedMultiplication​(java.lang.String recursionInfoLevel)
      • checkPartialSyntaxDuplicatedKeywords

        private boolean checkPartialSyntaxDuplicatedKeywords​(java.lang.String recursionInfoLevel)
      • checkPartialSyntaxUserDefinedArgument

        private boolean checkPartialSyntaxUserDefinedArgument​(java.lang.String recursionInfoLevel,
                                                              int tokenIndex,
                                                              Token token,
                                                              java.lang.String tokenInfoMessage)
      • checkPartialSyntaxUserDefinedRecursiveArgument

        private boolean checkPartialSyntaxUserDefinedRecursiveArgument​(java.lang.String recursionInfoLevel,
                                                                       int tokenIndex,
                                                                       Token token,
                                                                       java.lang.String tokenInfoMessage)
      • checkPartialSyntaxInvalidToken

        private boolean checkPartialSyntaxInvalidToken​(java.lang.String recursionInfoLevel,
                                                       Token token,
                                                       java.lang.String tokenInfoMessage,
                                                       java.util.Stack<SyntaxStackElement> syntaxStack)
      • checkPartialSyntaxUserDefinedFunction

        private boolean checkPartialSyntaxUserDefinedFunction​(java.lang.String recursionInfoLevel,
                                                              int tokenIndex,
                                                              Token token,
                                                              java.lang.String tokenInfoMessage)
      • checkPartialSyntaxBuiltinConstant

        private boolean checkPartialSyntaxBuiltinConstant​(java.lang.String recursionInfoLevel,
                                                          int tokenIndex,
                                                          Token token,
                                                          java.lang.String tokenInfoMessage)
      • checkPartialSyntaxUserDefinedConstant

        private boolean checkPartialSyntaxUserDefinedConstant​(java.lang.String recursionInfoLevel,
                                                              int tokenIndex,
                                                              Token token,
                                                              java.lang.String tokenStr)
      • checkPartialSyntaxUnaryFunction

        private boolean checkPartialSyntaxUnaryFunction​(java.lang.String recursionInfoLevel,
                                                        int tokenIndex,
                                                        Token token,
                                                        java.lang.String tokenInfoMessage)
      • checkPartialSyntaxBinaryFunction

        private boolean checkPartialSyntaxBinaryFunction​(java.lang.String recursionInfoLevel,
                                                         int tokenIndex,
                                                         Token token,
                                                         java.lang.String tokenInfoMessage)
      • checkPartialSyntaxTernaryFunction

        private boolean checkPartialSyntaxTernaryFunction​(java.lang.String recursionInfoLevel,
                                                          int tokenIndex,
                                                          Token token,
                                                          java.lang.String tokenInfoMessage)
      • checkInternalSyntaxCalculusOperatorDerivative

        private boolean checkInternalSyntaxCalculusOperatorDerivative​(java.lang.String recursionInfoLevel,
                                                                      Token token,
                                                                      java.lang.String tokenInfoMessage,
                                                                      java.util.Stack<SyntaxStackElement> syntaxStack,
                                                                      int paramsNumber,
                                                                      java.util.List<FunctionParameter> funParams)
      • checkInternalSyntaxCalculusOperatorDerivativeNth

        private boolean checkInternalSyntaxCalculusOperatorDerivativeNth​(java.lang.String recursionInfoLevel,
                                                                         Token token,
                                                                         java.lang.String tokenInfoMessage,
                                                                         java.util.Stack<SyntaxStackElement> syntaxStack,
                                                                         int paramsNumber,
                                                                         java.util.List<FunctionParameter> funParams)
      • checkInternalSyntaxCalculusOperatorIntegralSolve

        private boolean checkInternalSyntaxCalculusOperatorIntegralSolve​(java.lang.String recursionInfoLevel,
                                                                         Token token,
                                                                         java.lang.String tokenInfoMessage,
                                                                         java.util.Stack<SyntaxStackElement> syntaxStack,
                                                                         int paramsNumber,
                                                                         java.util.List<FunctionParameter> funParams)
      • checkInternalSyntaxCalculusOperatorIterated

        private boolean checkInternalSyntaxCalculusOperatorIterated​(java.lang.String recursionInfoLevel,
                                                                    Token token,
                                                                    java.lang.String tokenInfoMessage,
                                                                    java.util.Stack<SyntaxStackElement> syntaxStack,
                                                                    int paramsNumber,
                                                                    java.util.List<FunctionParameter> funParams)
      • checkInternalSyntaxCalculusOperatorForwardBackwardDiff

        private boolean checkInternalSyntaxCalculusOperatorForwardBackwardDiff​(java.lang.String recursionInfoLevel,
                                                                               Token token,
                                                                               java.lang.String tokenInfoMessage,
                                                                               java.util.Stack<SyntaxStackElement> syntaxStack,
                                                                               int paramsNumber,
                                                                               java.util.List<FunctionParameter> funParams)
      • checkPartialSyntaxVariadicFunction

        private boolean checkPartialSyntaxVariadicFunction​(java.lang.String recursionInfoLevel,
                                                           int tokenIndex,
                                                           Token token,
                                                           java.lang.String tokenInfoMessage)
      • checkPartialSyntaxCalculusOperator

        private boolean checkPartialSyntaxCalculusOperator​(java.lang.String recursionInfoLevel,
                                                           int tokenIndex,
                                                           Token token,
                                                           java.lang.String tokenInfoMessage,
                                                           java.util.Stack<SyntaxStackElement> syntaxStack)
      • performSyntaxStackPopIfEndOfSectionLevel

        private static void performSyntaxStackPopIfEndOfSectionLevel​(Token token,
                                                                     java.util.Stack<SyntaxStackElement> syntaxStack)
      • checkSyntax

        private boolean checkSyntax​(java.lang.String recursionInfoLevel,
                                    boolean functionWithBodyExt)
        Checking the syntax (recursively).
        Parameters:
        recursionInfoLevel - string representing the recursion level.
        Returns:
        true if syntax was correct, otherwise returns false.
      • calculate

        public double calculate()
        Calculates the expression value and registers all the calculation steps
        Returns:
        The expression value if syntax was ok, otherwise returns Double.NaN.
      • registerErrorWhileCalculate

        private void registerErrorWhileCalculate​(java.lang.String errorMessageToAdd)
      • calculate

        public double calculate​(CalcStepsRegister calcStepsRegister)
        Calculates the expression value
        Parameters:
        calcStepsRegister - A collection to store list of calculation steps, steps registered as strings.
        Returns:
        The expression value if syntax was ok, otherwise returns Double.NaN.
      • makeStepDescription

        private java.lang.String makeStepDescription()
      • registerCalculationStepRecord

        private void registerCalculationStepRecord​(CalcStepsRegister calcStepsRegister,
                                                   int stepsRegisteredCounter,
                                                   java.lang.String stepDescription)
      • registerCalculationStepRecord

        private void registerCalculationStepRecord​(CalcStepsRegister calcStepsRegister,
                                                   int stepsRegisteredCounter,
                                                   java.lang.String stepDescription,
                                                   double result)
      • calculateFirstAndFullyCompile

        private int calculateFirstAndFullyCompile​(CalcStepsRegister calcStepsRegister,
                                                  java.lang.String stepDescription)
      • applySequenceFromCompilation

        private int applySequenceFromCompilation​(CalcStepsRegister calcStepsRegister,
                                                 java.lang.String stepDescription)
      • calculateInternal

        private double calculateInternal​(CalcStepsRegister calcStepsRegister)
      • registerCompiledElement

        private void registerCompiledElement​(CompiledElement.ToCall toCall,
                                             int position)
      • registerCompiledElement

        private void registerCompiledElement​(CompiledElement.ToCall toCall,
                                             int position1,
                                             int position2)
      • f1ArgCalc

        private void f1ArgCalc​(int pos)
        Calculates unary function
        Parameters:
        pos - token position
      • f2ArgCalc

        private void f2ArgCalc​(int pos)
        Calculates binary function
        Parameters:
        pos - Token position
      • f3ArgCalc

        private void f3ArgCalc​(int pos)
        Calculates function with 3 arguments
        Parameters:
        pos - Token position
      • variadicFunCalc

        private void variadicFunCalc​(int pos)
        Calculates Variadic function
        Parameters:
        pos - Token position
      • calculusCalc

        private void calculusCalc​(int pos)
        Calculates calculus operators
        Parameters:
        pos -
      • rootOperCalc

        private void rootOperCalc​(int pos)
        Unicode root operators
        Parameters:
        pos -
      • bolCalc

        private void bolCalc​(int pos)
        Calculates boolean operators
        Parameters:
        pos -
      • bitwiseCalc

        private void bitwiseCalc​(int pos)
        Calculates Bitwise operators
        Parameters:
        pos -
      • initParserKeyWords

        private void initParserKeyWords()
        Creates parser keywords list
      • modifyParserKeyWords

        private void modifyParserKeyWords()
      • validateParserKeyWords

        private void validateParserKeyWords()
        Final validation of keywords
      • checkArgumentNameInCalculusOperator

        private boolean checkArgumentNameInCalculusOperator​(Token token)
        Method used in case of implied multiplication, where x2x can be understood as x2*x sum( x2x, 1, 20, 2*x2x) x2x is not known and it will be prevented from split into x2*x
        Parameters:
        token - The token
        Returns:
        Returns true in case calculus argument was found
      • checkSpecialConstantName

        private boolean checkSpecialConstantName​(Token token)
        Check whether we have a case of '[abc]'
        Parameters:
        token - The token
        Returns:
        Returns true in case token is in a form of '[abc]' otherwise returns false.
      • checkOtherNumberBases

        private boolean checkOtherNumberBases​(Token token)
        Checks whether unknown token represents number literal provided in different numeral base system, where base is between 1 and 36.
        Parameters:
        token - The token not know to the parser
      • addFractionToken

        private void addFractionToken​(Token token)
        Adds fraction token to the tokens list
        Parameters:
        token - The token
      • checkFraction

        private boolean checkFraction​(Token token)
        Checks whether unknown token represents fraction provided as fraction or mixed fraction
        Parameters:
        token - The token not know to the parser
      • initialTokensAdd

        private void initialTokensAdd​(Token token)
        Handles implied multiplication while adding single token to the tokens list is checking preceding token
        Parameters:
        token - The token
      • assignKnownKeyword

        private void assignKnownKeyword​(Token token,
                                        KeyWord keyWord)
        Assign found known keyword to the token
        Parameters:
        token - The token
        keyWord - The keyword
      • tryFindKnownKeyword

        private KeyWord tryFindKnownKeyword​(java.lang.String tokenStr)
        Tries to find known keyword for a given token via string matching
        Parameters:
        tokenStr - Token string
        Returns:
        known keyword if match found, otherwise not matched keyword
      • tryAssignKnownKeyword

        private boolean tryAssignKnownKeyword​(Token token)
        Tries to find known keyword for a given token via string matching
        Parameters:
        token - The token
        Returns:
        true if keyword matched, otherwise false
      • initialTokensAddTokenPart

        private void initialTokensAddTokenPart​(TokenPart tokenPart)
        Handles adding token part after single token split in the proces of parsing implied multiplication.
        Parameters:
        tokenPart - The token part to be added to the token list
      • checkNumberNameManyImpliedMultiplication

        private boolean checkNumberNameManyImpliedMultiplication​(Token token,
                                                                 boolean parenthesisIsOnTheRight)
        Handles implied multiplication logic in case of a single continuous string, e.g. no brackets
        Parameters:
        token - The token
        Returns:
        returns true in case there was a reason to parse, otherwise returns false
      • addToken

        private void addToken​(java.lang.String tokenStr,
                              KeyWord keyWord,
                              boolean parenthesisIsOnTheRight)
        Adds expression token Method is called by the tokenExpressionString() while parsing string expression
        Parameters:
        tokenStr - the token string
        keyWord - the keyword
      • addToken

        private void addToken​(java.lang.String tokenStr,
                              KeyWord keyWord)
      • addUserDefinedKeyWords

        private void addUserDefinedKeyWords()
      • tokenizeExpressionString

        private void tokenizeExpressionString()
        Tokenizing expression string
      • copyInitialTokens

        private void copyInitialTokens()
        copy initial tokens list to tokens list and prepares initial compilation details
      • getCopyOfInitialTokens

        public java.util.List<Token> getCopyOfInitialTokens()
        Tokenizes expression string and returns tokens list, including: string, type, level.
        Returns:
        Copy of initial tokens.
        See Also:
        Token, mXparser.consolePrintTokens(List)
      • consolePrintCopyOfInitialTokens

        public void consolePrintCopyOfInitialTokens()
        Prints to the console copy of initial tokens. Presents how expression string is interpreted by the parser.
        See Also:
        getCopyOfInitialTokens()
      • getMissingUserDefinedArguments

        public java.lang.String[] getMissingUserDefinedArguments()
        Returns missing user defined arguments names, i.e. sin(x) + cos(y) where x and y are not defined function will return x and y.
        Returns:
        Array of missing user defined arguments names - distinct strings.
      • getMissingUserDefinedUnits

        public java.lang.String[] getMissingUserDefinedUnits()
        Returns missing user defined units names, i.e. 2*[w] + [q] where [w] and [q] are not defined function will return [w] and [q].
        Returns:
        Array of missing user defined units names - distinct strings.
      • getMissingUserDefinedFunctions

        public java.lang.String[] getMissingUserDefinedFunctions()
        Returns missing user defined functions names, i.e. sin(x) + fun(x,y) where fun is not defined function will return fun.
        Returns:
        Array of missing user defined functions names - distinct strings.
      • getInitialTokens

        java.util.List<Token> getInitialTokens()
        Gets initial tokens and returns copied list
        See Also:
        Function
      • showParsing

        private void showParsing​(int lPos,
                                 int rPos)
        Shows parsing (verbose mode purposes).
      • showKeyWords

        void showKeyWords()
        shows known keywords
      • getHelp

        public java.lang.String getHelp()
        Returns detailed user help on the syntax of mathematical expressions.
        Returns:
        One string value containing all the help.
      • getHelp

        public java.lang.String getHelp​(java.lang.String query)
        Returns detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        Returns:
        One string value containing all the help.
      • getHelp

        public java.lang.String getHelp​(boolean addHeader,
                                        boolean addCaption,
                                        java.lang.String caption)
        Returns detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        addHeader - Indicator whether to add a header.
        addCaption - Indicator whether to add caption.
        caption - If a non-standard caption is to be added, any string other than "" will replace the standard caption with the one specified by the user.
        Returns:
        One string value containing all the help.
      • getHelp

        public java.lang.String getHelp​(java.lang.String query,
                                        boolean addHeader,
                                        boolean addCaption,
                                        java.lang.String caption)
        Returns detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        addHeader - Indicator whether to add a header.
        addCaption - Indicator whether to add caption.
        caption - If a non-standard caption is to be added, any string other than ""
        Returns:
        One string value containing all the help.
      • getHelpAsCsv

        public java.lang.String getHelpAsCsv()
        Returns (as CSV) detailed user help on the syntax of mathematical expressions.
        Returns:
        One string value in CSV format containing all the help.
      • getHelpAsCsv

        public java.lang.String getHelpAsCsv​(java.lang.String query)
        Returns (as CSV) detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        Returns:
        One string value in CSV format containing all the help.
      • getHelpAsCsv

        public java.lang.String getHelpAsCsv​(java.lang.String quote,
                                             java.lang.String delimiter,
                                             boolean addHeader)
        Returns (as CSV) detailed user help on the syntax of mathematical expressions.
        Parameters:
        quote - Text qualifier.
        delimiter - Delimiter.
        addHeader - Indicator whether to add a header.
        Returns:
        One string value in CSV format containing all the help.
      • getHelpAsCsv

        public java.lang.String getHelpAsCsv​(java.lang.String query,
                                             java.lang.String quote,
                                             java.lang.String delimiter,
                                             boolean addHeader)
        Returns (as CSV) detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        quote - Text qualifier.
        delimiter - Delimiter.
        addHeader - Indicator whether to add a header.
        Returns:
        One string value in CSV format containing all the help.
      • getHelpAsHtmlTable

        public java.lang.String getHelpAsHtmlTable()
        Returns (as HTML table) detailed user help on the syntax of mathematical expressions.
        Returns:
        One string value containing all the help. String in HTML table format.
      • getHelpAsHtmlTable

        public java.lang.String getHelpAsHtmlTable​(java.lang.String query)
        Returns (as HTML table) detailed user help on the syntax of mathematical expressions.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        Returns:
        One string value containing all the help. String in HTML table format.
      • getHelpAsHtmlTable

        public java.lang.String getHelpAsHtmlTable​(boolean addHeader,
                                                   boolean addCaption,
                                                   boolean addFigure,
                                                   java.lang.String caption,
                                                   java.lang.String cssClass)
        Returns (as HTML table) detailed user help on the syntax of mathematical expressions.
        Parameters:
        addHeader - Indicator whether to add a header.
        addCaption - Indicator whether to add caption.
        addFigure - Indicator whether to add a FIGURE tag.
        caption - If a non-standard caption is to be added, use any string other than "".
        cssClass - If CSS class is to be added, use any string other than "".
        Returns:
        One string value containing all the help. String in HTML table format.
      • getHelpAsHtmlTable

        public java.lang.String getHelpAsHtmlTable​(java.lang.String query,
                                                   boolean addHeader,
                                                   boolean addCaption,
                                                   boolean addFigure,
                                                   java.lang.String caption,
                                                   java.lang.String cssClass)
        Returns (as HTML table) detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        addHeader - Indicator whether to add a header.
        addCaption - Indicator whether to add caption.
        addFigure - Indicator whether to add a FIGURE tag.
        caption - If a non-standard caption is to be added, use any string other than "".
        cssClass - If CSS class is to be added, use any string other than "".
        Returns:
        One string value containing all the help. String in HTML table format.
      • getHelpAsMarkdownTable

        public java.lang.String getHelpAsMarkdownTable()
        Returns (as Markdown table) detailed user help on the syntax of mathematical expressions.
        Returns:
        One string value containing all the help. String in Markdown table format.
      • getHelpAsMarkdownTable

        public java.lang.String getHelpAsMarkdownTable​(java.lang.String query)
        Returns (as Markdown table) detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        Returns:
        One string value containing all the help. String in Markdown table format.
      • getHelpAsMarkdownTable

        public java.lang.String getHelpAsMarkdownTable​(boolean addHeader,
                                                       boolean addCaption,
                                                       java.lang.String caption)
        Returns (as Markdown table) detailed user help on the syntax of mathematical expressions.
        Parameters:
        addHeader - Indicator whether to add a header.
        addCaption - Indicator whether to add caption.
        caption - If a non-standard caption is to be added, use any string other than "".
        Returns:
        One string value containing all the help. String in Markdown table format.
      • getHelpAsMarkdownTable

        public java.lang.String getHelpAsMarkdownTable​(java.lang.String query,
                                                       boolean addHeader,
                                                       boolean addCaption,
                                                       java.lang.String caption)
        Returns (as Markdown table) detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        addHeader - Indicator whether to add a header.
        addCaption - Indicator whether to add caption.
        caption - If a non-standard caption is to be added, use any string other than "".
        Returns:
        One string value containing all the help. String in Markdown table format.
      • getHelpAsJson

        public java.lang.String getHelpAsJson()
        Returns (as Json) detailed user help on the syntax of mathematical expressions.
        Returns:
        One string value containing all the help. String in Json format.
      • getHelpAsJson

        public java.lang.String getHelpAsJson​(java.lang.String query)
        Returns (as Json) detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        Returns:
        One string value containing all the help. String in Json format.
      • getHelpAsJson

        public java.lang.String getHelpAsJson​(boolean addCaption,
                                              java.lang.String caption)
        Returns (as Json) detailed user help on the syntax of mathematical expressions.
        Parameters:
        addCaption - Indicator whether to add caption.
        caption - If a non-standard caption is to be added, use any string other than "".
        Returns:
        One string value containing all the help. String in Json format.
      • getHelpAsJson

        public java.lang.String getHelpAsJson​(java.lang.String query,
                                              boolean addCaption,
                                              java.lang.String caption)
        Returns (as Json) detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        addCaption - Indicator whether to add caption.
        caption - If a non-standard caption is to be added, use any string other than "".
        Returns:
        One string value containing all the help. String in Json format.
      • getKeyWords

        public java.util.List<KeyWord> getKeyWords​(java.lang.String query)
        Returns list of keywords known to the parser. Allows simple and advanced searches.
        Parameters:
        query - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "key=" - keyword (e.g.: "key=sin"), "desc=" - description (e.g.: "desc=trigonometric"), "syn=" - syntax (e.g.: "syn=sin"), "type=" - type (e.g.: "type=unit"), "since=" - since (e.g.: "since=4.1"), "typeid=" - please refer to parser tokens (e.g.: "typeid=3"), "keyid=" - please refer to parser tokens (e.g.: "keyid=1004"). Only one tag can be used per search.
        Returns:
        List of keywords known to the parser filter against query string.
        See Also:
        KeyWord, KeyWord.wordTypeId, getHelp(String)
      • showTokens

        void showTokens()
      • showTokens

        static void showTokens​(java.util.List<Token> tokensList)
      • showInitialTokens

        void showInitialTokens()
        shows initial tokens
      • showArguments

        private void showArguments()
      • printSystemInfo

        private void printSystemInfo​(java.lang.String info,
                                     boolean withExpressionString)
        Parameters:
        info -
        withExpressionString -
      • clone

        protected Expression clone()
        Expression cloning.
        Overrides:
        clone in class java.lang.Object
      • cloneForThreadSafe

        public Expression cloneForThreadSafe()
        Creates a completely independent 1-1 clone that can be safely used by a separate thread. If the cloned element contains references to other elements (e.g. arguments, functions, constants), then they will also be cloned and the newly created element will contain references to the corresponding clones. Important - the API allows you to extract all these clones.
        Returns:
        Cloned object.