Class AbstractMathFunction
java.lang.Object
org.eclipse.nebula.widgets.nattable.formula.function.AbstractFunction
org.eclipse.nebula.widgets.nattable.formula.function.AbstractMathFunction
- All Implemented Interfaces:
FunctionValue,OperatorFunctionValue
- Direct Known Subclasses:
AbstractMathSingleValueFunction,ModFunction,PowerFunction,ProductFunction,QuotientFunction,SumFunction
Subclass of this class are intended to perform mathematical operations on the
values set to it. It supports conversion of values to
BigDecimal and
ensures that only valid FunctionValues are accepted.- Since:
- 1.4
-
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.nattable.formula.function.AbstractFunction
values -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFunctionValue(FunctionValue value) Add the givenFunctionValuefor calculation.protected BigDecimalconvertValue(Object value) Converts a given value to aBigDecimal.protected voidvalidateMethodParameter(List<FunctionValue> values) Performs a type check for the given list ofFunctionValues and throws aFunctionExceptionin case aStringFunctionValueis contained.Methods inherited from class org.eclipse.nebula.widgets.nattable.formula.function.AbstractFunction
isEmptyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.nebula.widgets.nattable.formula.function.FunctionValue
getValue
-
Constructor Details
-
AbstractMathFunction
public AbstractMathFunction() -
AbstractMathFunction
-
-
Method Details
-
addFunctionValue
Description copied from interface:OperatorFunctionValueAdd the givenFunctionValuefor calculation.- Specified by:
addFunctionValuein interfaceOperatorFunctionValue- Overrides:
addFunctionValuein classAbstractFunction- Parameters:
value- The value to add.
-
convertValue
Converts a given value to aBigDecimal.- Parameters:
value- The object to convert.- Returns:
- The
BigDecimalrepresentation of the given object. - Throws:
NumberFormatException- is the given value can not be converted to aBigDecimal
-
validateMethodParameter
Performs a type check for the given list ofFunctionValues and throws aFunctionExceptionin case aStringFunctionValueis contained.- Parameters:
values- The list ofFunctionValuethat should be checked.- Throws:
FunctionException- if aStringFunctionValueis detected.
-