Class NumberExtensions
java.lang.Object
org.openhab.core.model.script.lib.NumberExtensions
This class contains all kinds of extensions to be used by scripts and not
 provided by Xbase. These include things like number handling and comparisons.
- Author:
 - Kai Kreuzer - Initial contribution
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BigDecimalIt is the definition of Java null pointer for the rules language. - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimalnumberToBigDecimal(Number number) Convert the given number into a BigDecimalstatic BigDecimaloperator_divide(Number x, Number y) static QuantityType<?>operator_divide(Number x, QuantityType<?> y) static QuantityType<?>operator_divide(QuantityType<?> x, Number y) static QuantityType<?>operator_divide(QuantityType<?> x, QuantityType<?> y) static booleanoperator_equals(Number left, Number right) static booleanoperator_equals(QuantityType<?> left, Number right) static booleanoperator_equals(QuantityType<?> left, QuantityType<?> right) static booleanoperator_equals(Type type, Number x) static booleanoperator_greaterEqualsThan(Number left, Number right) static booleanoperator_greaterEqualsThan(QuantityType<?> x, Number y) static booleanoperator_greaterEqualsThan(QuantityType<?> x, QuantityType<?> y) static booleanoperator_greaterEqualsThan(Type type, Number x) static booleanoperator_greaterThan(Number left, Number right) static booleanoperator_greaterThan(QuantityType<?> x, Number y) static booleanoperator_greaterThan(QuantityType<?> x, QuantityType<?> y) static booleanoperator_greaterThan(Type type, Number x) static booleanoperator_lessEqualsThan(Number left, Number right) static booleanoperator_lessEqualsThan(QuantityType<?> x, Number y) static booleanoperator_lessEqualsThan(QuantityType<?> x, QuantityType<?> y) static booleanoperator_lessEqualsThan(Type type, Number x) static booleanoperator_lessThan(Number left, Number right) static booleanoperator_lessThan(QuantityType<?> x, Number y) static booleanoperator_lessThan(QuantityType<?> x, QuantityType<?> y) static booleanoperator_lessThan(Type type, Number x) static BigDecimalstatic BigDecimaloperator_minus(Number x, Number y) static QuantityType<?>operator_minus(QuantityType<?> x) static QuantityType<?>operator_minus(QuantityType<?> x, QuantityType<?> y) static BigDecimaloperator_multiply(Number x, Number y) static QuantityType<?>operator_multiply(Number x, QuantityType<?> y) static QuantityType<?>operator_multiply(QuantityType<?> x, Number y) static QuantityType<?>operator_multiply(QuantityType<?> x, QuantityType<?> y) static booleanoperator_notEquals(Number left, Number right) static booleanoperator_notEquals(QuantityType<?> left, Number right) static booleanoperator_notEquals(QuantityType<?> left, QuantityType<?> right) static booleanoperator_notEquals(Type type, Number x) static BigDecimaloperator_plus(Number x, Number y) static QuantityType<?>operator_plus(QuantityType<?> x, QuantityType<?> y)  
- 
Field Details
- 
NULL_DEFINITION
It is the definition of Java null pointer for the rules language. Actually its value is 0 (rules variables are number) but we can use the null pointer and throws an NPE when a null value is used. I think this concept should not exist for those who writes the rules. 
 - 
 - 
Constructor Details
- 
NumberExtensions
public NumberExtensions() 
 - 
 - 
Method Details
- 
operator_plus
 - 
operator_minus
 - 
operator_minus
 - 
operator_multiply
 - 
operator_divide
 - 
operator_equals
 - 
operator_notEquals
 - 
operator_lessThan
 - 
operator_greaterThan
 - 
operator_lessEqualsThan
 - 
operator_greaterEqualsThan
 - 
operator_equals
 - 
operator_notEquals
 - 
operator_greaterThan
 - 
operator_greaterEqualsThan
 - 
operator_lessThan
 - 
operator_lessEqualsThan
 - 
operator_plus
 - 
operator_minus
 - 
operator_minus
 - 
operator_multiply
 - 
operator_multiply
 - 
operator_multiply
 - 
operator_divide
 - 
operator_divide
 - 
operator_divide
 - 
operator_equals
 - 
operator_equals
 - 
operator_notEquals
 - 
operator_notEquals
 - 
operator_lessThan
 - 
operator_lessThan
 - 
operator_lessEqualsThan
 - 
operator_lessEqualsThan
 - 
operator_greaterThan
 - 
operator_greaterThan
 - 
operator_greaterEqualsThan
 - 
operator_greaterEqualsThan
 - 
numberToBigDecimal
Convert the given number into a BigDecimal- Parameters:
 number- the number to convert- Returns:
 - the given number as BigDecimal or null if number is null
 
 
 -