public NumberNumberCallSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params, Number receiver, Number arg) { super(site, metaClass, metaMethod, params); math = NumberMath.getMath(receiver,arg); } }
public static Number xor(Number left, Number right) { return getMath(left, right).xorImpl(left, right); }
public static Number unaryPlus(Number left) { return getMath(left).unaryPlusImpl(left); }
public static Number add(Number left, Number right) { return getMath(left, right).addImpl(left, right); }
public static Number bitwiseNegate(Number left) { return getMath(left).bitwiseNegateImpl(left); }
public static Number abs(Number number) { return getMath(number).absImpl(number); }
public static Number multiply(Number left, Number right) { return getMath(left, right).multiplyImpl(left, right); }
public static Number and(Number left, Number right) { return getMath(left, right).andImpl(left, right); }
public static Number unaryMinus(Number left) { return getMath(left).unaryMinusImpl(left); }
public static Number divide(Number left, Number right) { return getMath(left, right).divideImpl(left, right); }
public static int compareTo(Number left, Number right) { return getMath(left, right).compareToImpl(left, right); }
public static Number subtract(Number left, Number right) { return getMath(left, right).subtractImpl(left, right); }
public static Number or(Number left, Number right) { return getMath(left, right).orImpl(left, right); }
public static Number intdiv(Number left, Number right) { return getMath(left, right).intdivImpl(left, right); }
public static Number mod(Number left, Number right) { return getMath(left, right).modImpl(left, right); }
/** * For this operation, consider the operands independently. Throw an exception if the right operand * (shift distance) is not an integral type. For the left operand (shift value) also require an integral * type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the * shift operators. */ public static Number rightShift(Number left, Number right) { if (isFloatingPoint(right) || isBigDecimal(right)) { throw new UnsupportedOperationException("Shift distance must be an integral type, but " + right + " (" + right.getClass().getName() + ") was supplied"); } return getMath(left).rightShiftImpl(left, right); }
/** * For this operation, consider the operands independently. Throw an exception if the right operand * (shift distance) is not an integral type. For the left operand (shift value) also require an integral * type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the * shift operators. */ public static Number leftShift(Number left, Number right) { if (isFloatingPoint(right) || isBigDecimal(right)) { throw new UnsupportedOperationException("Shift distance must be an integral type, but " + right + " (" + right.getClass().getName() + ") was supplied"); } return getMath(left).leftShiftImpl(left, right); }
/** * For this operation, consider the operands independently. Throw an exception if the right operand * (shift distance) is not an integral type. For the left operand (shift value) also require an integral * type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the * shift operators. */ public static Number rightShiftUnsigned(Number left, Number right) { if (isFloatingPoint(right) || isBigDecimal(right)) { throw new UnsupportedOperationException("Shift distance must be an integral type, but " + right + " (" + right.getClass().getName() + ") was supplied"); } return getMath(left).rightShiftUnsignedImpl(left, right); }
/** * For this operation, consider the operands independently. Throw an exception if the right operand * (shift distance) is not an integral type. For the left operand (shift value) also require an integral * type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the * shift operators. */ public static Number leftShift(Number left, Number right) { if (isFloatingPoint(right) || isBigDecimal(right)) { throw new UnsupportedOperationException("Shift distance must be an integral type, but " + right + " (" + right.getClass().getName() + ") was supplied"); } return getMath(left).leftShiftImpl(left,right); }