@Override public Number modulus(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { return Integer.valueOf(first.intValue() % second.intValue()); } case LONG: { return Long.valueOf(first.longValue() % second.longValue()); } case FLOAT: { return Float.valueOf(first.floatValue() % second.floatValue()); } case DOUBLE: { return Double.valueOf(first.doubleValue() % second.doubleValue()); } case BIGINTEGER: { BigInteger n1 = toBigInteger(first); BigInteger n2 = toBigInteger(second); return n1.mod(n2); } case BIGDECIMAL: { throw new _MiscTemplateException("Can't calculate remainder on BigDecimals"); } } // Make the compiler happy. getCommonClassCode() is guaranteed to // return only above codes, or throw an exception. throw new BugException(); }
@Override public int compareNumbers(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public Number divide(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public Number multiply(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public Number add(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
public Number multiply(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
public Number subtract(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
public Number add(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public Number subtract(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public Number add(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public int compareNumbers(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public Number subtract(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public int compareNumbers(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
public int compareNumbers(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public Number modulus(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { return Integer.valueOf(first.intValue() % second.intValue()); } case LONG: { return Long.valueOf(first.longValue() % second.longValue()); } case FLOAT: { return Float.valueOf(first.floatValue() % second.floatValue()); } case DOUBLE: { return Double.valueOf(first.doubleValue() % second.doubleValue()); } case BIGINTEGER: { BigInteger n1 = toBigInteger(first); BigInteger n2 = toBigInteger(second); return n1.mod(n2); } case BIGDECIMAL: { throw new _MiscTemplateException("Can't calculate remainder on BigDecimals"); } } // Make the compiler happy. getCommonClassCode() is guaranteed to // return only above codes, or throw an exception. throw new BugException(); }
@Override public Number modulus(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { return Integer.valueOf(first.intValue() % second.intValue()); } case LONG: { return Long.valueOf(first.longValue() % second.longValue()); } case FLOAT: { return Float.valueOf(first.floatValue() % second.floatValue()); } case DOUBLE: { return Double.valueOf(first.doubleValue() % second.doubleValue()); } case BIGINTEGER: { BigInteger n1 = toBigInteger(first); BigInteger n2 = toBigInteger(second); return n1.mod(n2); } case BIGDECIMAL: { throw new _MiscTemplateException("Can't calculate remainder on BigDecimals"); } } // Make the compiler happy. getCommonClassCode() is guaranteed to // return only above codes, or throw an exception. throw new BugException(); }
public Number modulus(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { return new Integer(first.intValue() % second.intValue()); } case LONG: { return new Long(first.longValue() % second.longValue()); } case FLOAT: { return new Float(first.floatValue() % second.floatValue()); } case DOUBLE: { return new Double(first.doubleValue() % second.doubleValue()); } case BIGINTEGER: { BigInteger n1 = toBigInteger(first); BigInteger n2 = toBigInteger(second); return n1.mod(n2); } case BIGDECIMAL: { throw new TemplateException("Can't calculate remainder on BigDecimals", Environment.getCurrentEnvironment()); } } // Make the compiler happy. getCommonClassCode() is guaranteed to // return only above codes, or throw an exception. throw new Error(); }
@Override public Number subtract(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public Number add(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();
@Override public Number multiply(Number first, Number second) throws TemplateException { switch(getCommonClassCode(first, second)) { case INTEGER: { int n1 = first.intValue();