Class Parameters

java.lang.Object
com.fathzer.soft.javaluator.Parameters

public class Parameters extends Object
The parameters of an evaluator.
An evaluator may have different parameters as the supported operators, the supported functions, etc ...
Author:
Jean-Marc Astesana
See Also:
  • Constructor Details

    • Parameters

      public Parameters()
      Constructor.
      This method builds an instance with no operator, no function, no constant, no translation and no bracket
      Function argument separator is set to ','.
  • Method Details

    • getOperators

      public Collection<Operator> getOperators()
      Gets the supported operators.
      Returns:
      a Collection of operators.
    • getFunctions

      public Collection<Function> getFunctions()
      Gets the supported functions.
      Returns:
      a Collection of functions.
    • getConstants

      public Collection<Constant> getConstants()
      Gets the supported constants.
      Returns:
      a Collection of constants.
    • getExpressionBrackets

      public Collection<BracketPair> getExpressionBrackets()
      Gets the supported bracket pairs for expressions.
      Returns:
      a Collection of bracket pairs.
    • getFunctionBrackets

      public Collection<BracketPair> getFunctionBrackets()
      Gets the supported bracket pairs for functions.
      Returns:
      a Collection of bracket pairs.
    • addOperators

      public void addOperators(Collection<Operator> operators)
      Adds operators to the supported ones.
      Parameters:
      operators - The operators to be added.
    • add

      public void add(Operator operator)
      Adds an operator to the supported ones.
      Parameters:
      operator - The added operator
    • addFunctions

      public void addFunctions(Collection<Function> functions)
      Adds functions to the supported ones.
      Parameters:
      functions - The functions to be added.
    • add

      public void add(Function function)
      Adds a function to the supported ones.
      Parameters:
      function - The added function
    • addConstants

      public void addConstants(Collection<Constant> constants)
      Adds constants to the supported ones.
      Parameters:
      constants - The constants to be added.
    • add

      public void add(Constant constant)
      Adds a constant to the supported ones.
      Parameters:
      constant - The added constant
    • addExpressionBracket

      public void addExpressionBracket(BracketPair pair)
      Adds a new bracket pair to the expression bracket list.
      Parameters:
      pair - A bracket pair
    • addExpressionBrackets

      public void addExpressionBrackets(Collection<BracketPair> brackets)
      Adds bracket pairs to the expression bracket list.
      Parameters:
      brackets - The brackets to be added.
    • addFunctionBracket

      public void addFunctionBracket(BracketPair pair)
      Adds a new bracket pair to the function bracket list.
      Parameters:
      pair - A bracket pair
    • addFunctionBrackets

      public void addFunctionBrackets(Collection<BracketPair> brackets)
      Adds bracket pairs to the function bracket list.
      Parameters:
      brackets - The brackets to be added.
    • setTranslation

      public void setTranslation(Function function, String translatedName)
      Sets the translated term for a function.
      Using this method, you can localize the names of some built-in functions. For instance, for french people,you can use this method to use "somme" instead of "sum" with the SUM built-in function of DoubleEvaluator.
      Parameters:
      function - The function you want to translate the name
      translatedName - The translated name
      See Also:
    • setTranslation

      public void setTranslation(Constant constant, String translatedName)
      Sets the translated term for a constant.
      Parameters:
      constant - The constant you want to translate the name
      translatedName - The translated name
      See Also:
    • setFunctionArgumentSeparator

      public void setFunctionArgumentSeparator(char separator)
      Sets the function argument separator.
      Its default value is ','.
      Parameters:
      separator - The new separator
    • getFunctionArgumentSeparator

      public String getFunctionArgumentSeparator()
      Gets the function argument separator.
      Returns:
      a string