public static BigDecimal cast(BigDecimalValue x, BigDecimal y) { if (x == null) { return null; } return x.getValue(); }
/** Function constructor **/ public BigDecimalValue(BigDecimalValue result, NumberOperations function, BigDecimalValue[] params) { super(function, params); this.value = result.getValue(); }
public static BigDecimal cast(BigDecimalValue x, BigDecimal y) { if (x == null) { return null; } return x.getValue(); }
/** Function constructor **/ public BigDecimalValue(BigDecimalValue result, NumberOperations function, BigDecimalValue[] params) { super(function, params); this.value = result.getValue(); }
@Override public BigDecimal convert(BigDecimalValue param) { if (param == null) { return null; } return param.getValue(); };
public static BigInteger cast(BigDecimalValue x, BigInteger y) { if (x == null) { return null; } return x.getValue().toBigInteger(); }
public static BigInteger cast(BigDecimalValue x, BigInteger y) { if (x == null) { return null; } return x.getValue().toBigInteger(); }
@Override /** * Indicates whether some other object is "equal to" this org.openl.meta.BigDecimalValue variable. */ public boolean equals(Object obj) { if (obj instanceof org.openl.meta.BigDecimalValue) { org.openl.meta.BigDecimalValue secondObj = (org.openl.meta.BigDecimalValue) obj; return Comparison.eq(getValue(), secondObj.getValue()); } return false; }
/** * Compares two values * @param value1 * @param value2 * @return true if value1 equal value2 */ public static boolean eq(org.openl.meta.BigDecimalValue value1, org.openl.meta.BigDecimalValue value2) { if (value1 == null || value2 == null){ return value1 == value2; } return Comparison.eq(value1.getValue(), value2.getValue()); } /**
@Override /** * Indicates whether some other object is "equal to" this org.openl.meta.BigDecimalValue variable. */ public boolean equals(Object obj) { if (obj instanceof org.openl.meta.BigDecimalValue) { org.openl.meta.BigDecimalValue secondObj = (org.openl.meta.BigDecimalValue) obj; return Comparison.eq(getValue(), secondObj.getValue()); } return false; }
/** * Compares two values * @param value1 * @param value2 * @return true if value1 not equal value2 */ public static boolean ne(org.openl.meta.BigDecimalValue value1, org.openl.meta.BigDecimalValue value2) { if (value1 == null || value2 == null){ return value1 != value2; } return Comparison.ne(value1.getValue(), value2.getValue()); } /**
private static BigDecimal[] unwrap(BigDecimalValue[] values) { if (values == null) { return null; } values = ArrayTool.removeNulls(values); BigDecimal[] unwrappedArray = new BigDecimal[values.length]; for (int i = 0; i < values.length; i++) { unwrappedArray[i] = values[i].getValue(); } return unwrappedArray; }
private static BigDecimal[] unwrap(BigDecimalValue[] values) { if (values == null) { return null; } values = ArrayTool.removeNulls(values); BigDecimal[] unwrappedArray = new BigDecimal[values.length]; for (int i = 0; i < values.length; i++) { unwrappedArray[i] = values[i].getValue(); } return unwrappedArray; }
/** * * @param number * @param divisor * @return the remainder after a number is divided by a divisor. The result is a numeric value and has the same sign as the devisor. */ public static org.openl.meta.BigDecimalValue mod(org.openl.meta.BigDecimalValue number, org.openl.meta.BigDecimalValue divisor) { if (number != null && divisor != null) { org.openl.meta.BigDecimalValue result = new org.openl.meta.BigDecimalValue(MathUtils.mod(number.getValue(), divisor.getValue())); return new org.openl.meta.BigDecimalValue(result, NumberOperations.MOD, new org.openl.meta.BigDecimalValue[]{number, divisor} ); } return null; }
/** * Divides left hand operand by right hand operand * @param number org.openl.meta.BigDecimalValue * @param divisor org.openl.meta.BigDecimalValue * @return LongValue the result of division operation */ public static LongValue quotient(org.openl.meta.BigDecimalValue number, org.openl.meta.BigDecimalValue divisor) { if (number != null && divisor != null) { LongValue result = new LongValue(MathUtils.quotient(number.getValue(), divisor.getValue())); return new LongValue(result, NumberOperations.QUOTIENT, null); } return null; }
/** * Divides left hand operand by right hand operand * @param number org.openl.meta.BigDecimalValue * @param divisor org.openl.meta.BigDecimalValue * @return LongValue the result of division operation */ public static LongValue quotient(org.openl.meta.BigDecimalValue number, org.openl.meta.BigDecimalValue divisor) { if (number != null && divisor != null) { LongValue result = new LongValue(MathUtils.quotient(number.getValue(), divisor.getValue())); return new LongValue(result, NumberOperations.QUOTIENT, null); } return null; }
/** * * @param number * @param divisor * @return the remainder after a number is divided by a divisor. The result is a numeric value and has the same sign as the devisor. */ public static org.openl.meta.BigDecimalValue mod(org.openl.meta.BigDecimalValue number, org.openl.meta.BigDecimalValue divisor) { if (number != null && divisor != null) { org.openl.meta.BigDecimalValue result = new org.openl.meta.BigDecimalValue(MathUtils.mod(number.getValue(), divisor.getValue())); return new org.openl.meta.BigDecimalValue(result, NumberOperations.MOD, new org.openl.meta.BigDecimalValue[]{number, divisor} ); } return null; }
public static BigDecimalValue round(BigDecimalValue value, int scale, int roundingMethod) { if (value == null) { return null; } return new BigDecimalValue(new BigDecimalValue(value.getValue().setScale(scale, roundingMethod)), NumberOperations.ROUND, new BigDecimalValue[] { value }); }
public static BigDecimalValue round(BigDecimalValue value, int scale, int roundingMethod) { if (value == null) { return null; } return new BigDecimalValue(new BigDecimalValue(value.getValue().setScale(scale, roundingMethod)), NumberOperations.ROUND, new BigDecimalValue[] { value }); }
public static BigDecimalValue add(String value1, BigDecimalValue value2) { if (value1 == null) { return value2; } if (value2 == null) { return new BigDecimalValue(new BigDecimal(value1)); } BigDecimal v = new BigDecimal(value1); return new org.openl.meta.BigDecimalValue(new BigDecimalValue(v), value2, Operators.add(v, value2.getValue()), Formulas.ADD); }