public final static class LongDelegate extends ELArithmetic { protected Number add(Number num0, Number num1) { return new Long(num0.longValue() + num1.longValue()); } protected Number coerce(Number num) { if (num instanceof Long) return num; return new Long(num.longValue()); } protected Number coerce(String str) { return new Long(str); } protected Number divide(Number num0, Number num1) { return new Long(num0.longValue() / num1.longValue()); } protected Number mod(Number num0, Number num1) { return new Long(num0.longValue() % num1.longValue()); } protected Number subtract(Number num0, Number num1) { return new Long(num0.longValue() - num1.longValue()); } protected Number multiply(Number num0, Number num1) { return new Long(num0.longValue() * num1.longValue()); } public boolean matches(Object obj0, Object obj1) { return (obj0 instanceof Long || obj1 instanceof Long); } }
public final static Number multiply(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.multiply(num0, num1); }
public final static class LongDelegate extends ELArithmetic { protected Number add(Number num0, Number num1) { return new Long(num0.longValue() + num1.longValue()); } protected Number coerce(Number num) { if (num instanceof Long) return num; return new Long(num.longValue()); } protected Number coerce(String str) { return new Long(str); } protected Number divide(Number num0, Number num1) { return new Long(num0.longValue() / num1.longValue()); } protected Number mod(Number num0, Number num1) { return new Long(num0.longValue() % num1.longValue()); } protected Number subtract(Number num0, Number num1) { return new Long(num0.longValue() - num1.longValue()); } protected Number multiply(Number num0, Number num1) { return new Long(num0.longValue() * num1.longValue()); } public boolean matches(Object obj0, Object obj1) { return (obj0 instanceof Long || obj1 instanceof Long); } }
public final static class LongDelegate extends ELArithmetic { protected Number add(Number num0, Number num1) { return new Long(num0.longValue() + num1.longValue()); } protected Number coerce(Number num) { if (num instanceof Long) return num; return new Long(num.longValue()); } protected Number coerce(String str) { return new Long(str); } protected Number divide(Number num0, Number num1) { return new Long(num0.longValue() / num1.longValue()); } protected Number mod(Number num0, Number num1) { return new Long(num0.longValue() % num1.longValue()); } protected Number subtract(Number num0, Number num1) { return new Long(num0.longValue() - num1.longValue()); } protected Number multiply(Number num0, Number num1) { return new Long(num0.longValue() * num1.longValue()); } public boolean matches(Object obj0, Object obj1) { return (obj0 instanceof Long || obj1 instanceof Long); } }
public final static Number subtract(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.subtract(num0, num1); }
public final static Number add(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.add(num0, num1); }
public final static Number subtract(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.subtract(num0, num1); }
public final static Number add(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.add(num0, num1); }
public final static Number multiply(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.multiply(num0, num1); }
public final static Number multiply(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.multiply(num0, num1); }
public final static Number mod(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.mod(num0, num1); }
public final static Number subtract(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.subtract(num0, num1); }
public final static Number add(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.add(num0, num1); }
public final static Number mod(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.mod(num0, num1); }
public final static Number divide(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return ZERO; } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGDECIMAL; else delegate = DOUBLE; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.divide(num0, num1); }
public final static Number divide(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return ZERO; } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGDECIMAL; else delegate = DOUBLE; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.divide(num0, num1); }
public final static Number mod(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return new Long(0); } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (DOUBLE.matches(obj0, obj1)) delegate = DOUBLE; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGINTEGER; else delegate = LONG; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.mod(num0, num1); }
public final static Number divide(final Object obj0, final Object obj1) { if (obj0 == null && obj1 == null) { return ZERO; } final ELArithmetic delegate; if (BIGDECIMAL.matches(obj0, obj1)) delegate = BIGDECIMAL; else if (BIGINTEGER.matches(obj0, obj1)) delegate = BIGDECIMAL; else delegate = DOUBLE; Number num0 = delegate.coerce(obj0); Number num1 = delegate.coerce(obj1); return delegate.divide(num0, num1); }