Package com.fathzer.soft.javaluator
Class Parameters
java.lang.Object
com.fathzer.soft.javaluator.Parameters
The parameters of an evaluator.
An evaluator may have different parameters as the supported operators, the supported functions, etc ...
An evaluator may have different parameters as the supported operators, the supported functions, etc ...
- Author:
- Jean-Marc Astesana
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a constant to the supported ones.voidAdds a function to the supported ones.voidAdds an operator to the supported ones.voidaddConstants(Collection<Constant> constants) Adds constants to the supported ones.voidAdds a new bracket pair to the expression bracket list.voidaddExpressionBrackets(Collection<BracketPair> brackets) Adds bracket pairs to the expression bracket list.voidAdds a new bracket pair to the function bracket list.voidaddFunctionBrackets(Collection<BracketPair> brackets) Adds bracket pairs to the function bracket list.voidaddFunctions(Collection<Function> functions) Adds functions to the supported ones.voidaddOperators(Collection<Operator> operators) Adds operators to the supported ones.Gets the supported constants.Gets the supported bracket pairs for expressions.Gets the function argument separator.Gets the supported bracket pairs for functions.Gets the supported functions.Gets the supported operators.voidsetFunctionArgumentSeparator(char separator) Sets the function argument separator.voidsetTranslation(Constant constant, String translatedName) Sets the translated term for a constant.voidsetTranslation(Function function, String translatedName) Sets the translated term for a function.
-
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
Gets the supported operators.- Returns:
- a Collection of operators.
-
getFunctions
Gets the supported functions.- Returns:
- a Collection of functions.
-
getConstants
Gets the supported constants.- Returns:
- a Collection of constants.
-
getExpressionBrackets
Gets the supported bracket pairs for expressions.- Returns:
- a Collection of bracket pairs.
-
getFunctionBrackets
Gets the supported bracket pairs for functions.- Returns:
- a Collection of bracket pairs.
-
addOperators
Adds operators to the supported ones.- Parameters:
operators- The operators to be added.
-
add
Adds an operator to the supported ones.- Parameters:
operator- The added operator
-
addFunctions
Adds functions to the supported ones.- Parameters:
functions- The functions to be added.
-
add
Adds a function to the supported ones.- Parameters:
function- The added function
-
addConstants
Adds constants to the supported ones.- Parameters:
constants- The constants to be added.
-
add
Adds a constant to the supported ones.- Parameters:
constant- The added constant
-
addExpressionBracket
Adds a new bracket pair to the expression bracket list.- Parameters:
pair- A bracket pair
-
addExpressionBrackets
Adds bracket pairs to the expression bracket list.- Parameters:
brackets- The brackets to be added.
-
addFunctionBracket
Adds a new bracket pair to the function bracket list.- Parameters:
pair- A bracket pair
-
addFunctionBrackets
Adds bracket pairs to the function bracket list.- Parameters:
brackets- The brackets to be added.
-
setTranslation
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 nametranslatedName- The translated name- See Also:
-
setTranslation
Sets the translated term for a constant.- Parameters:
constant- The constant you want to translate the nametranslatedName- 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
Gets the function argument separator.- Returns:
- a string
-