Package cdm.base.math.functions
Class RoundToNearest
java.lang.Object
cdm.base.math.functions.RoundToNearest
- All Implemented Interfaces:
com.rosetta.model.lib.functions.RosettaFunction
- Direct Known Subclasses:
RoundToNearest.RoundToNearestDefault,RoundToNearestImpl
public abstract class RoundToNearest
extends Object
implements com.rosetta.model.lib.functions.RosettaFunction
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.rosetta.model.lib.functions.ConditionValidator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BigDecimaldoEvaluate(BigDecimal value, BigDecimal nearest, RoundingModeEnum roundingMode) evaluate(BigDecimal value, BigDecimal nearest, RoundingModeEnum roundingMode) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.rosetta.model.lib.functions.RosettaFunction
toBuilder, toBuilder, toBuilder
-
Field Details
-
conditionValidator
@Inject protected com.rosetta.model.lib.functions.ConditionValidator conditionValidator
-
-
Constructor Details
-
RoundToNearest
public RoundToNearest()
-
-
Method Details
-
evaluate
- Parameters:
value- The original (unrounded) number.nearest- The nearest number to round to.roundingMode- The method of rounding (up to nearest/down to nearest).- Returns:
- roundedValue
-
doEvaluate
protected abstract BigDecimal doEvaluate(BigDecimal value, BigDecimal nearest, RoundingModeEnum roundingMode)
-