Class MathematicalContext
java.lang.Object
de.espirit.firstspirit.access.template.MathematicalContext
Context container definition for a mathematical context, allowing to define the precision of
mathematical computation within an evaluation process.
- Since:
- 4.1.16
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull MathContext
Provides the defined mathematical context.void
setMathContext
(@NotNull MathContext value) Sets the matthematical contextvoid
setPrecision
(int precision) Set precision, seeMathContext.getPrecision()
.void
setRoundingMode
(@NotNull RoundingMode mode) Sets the rounding mode for this context.void
Reset to default:DEFAULT_MATH_CONTEXT
.
-
Field Details
-
DEFAULT_MATH_CONTEXT
A default context.- Since:
- 4.1.16
-
-
Constructor Details
-
MathematicalContext
public MathematicalContext()Constructor using the default context.- Since:
- 4.1.16
-
-
Method Details
-
getMathContext
Provides the defined mathematical context.- Since:
- 4.1.16
-
setMathContext
Sets the matthematical context.#- Parameters:
value
- The context to use.- Since:
- 4.1.16
-
setPrecision
public void setPrecision(int precision) Set precision, seeMathContext.getPrecision()
.- Parameters:
precision
- a value between 0 andInteger.MAX_VALUE
- Since:
- 4.1.16
-
setRoundingMode
Sets the rounding mode for this context.- Parameters:
mode
- The rounding mode.- Since:
- 4.1.16
-
useDefault
public void useDefault()Reset to default:DEFAULT_MATH_CONTEXT
.- Since:
- 4.1.16
-