text: public static double calculate(double pStartDateVal, double pEndDateVal, int basis) throws EvaluationException {if (basis < 0 || basis >= 5) {throw new EvaluationException(ErrorEval.NUM_ERROR);}int startDateVal = (int) Math.floor(pStartDateVal);int endDateVal = (int) Math.floor(pEndDateVal);if (startDateVal == endDateVal) {return 0;}if (startDateVal > endDateVal) {int temp = startDateVal;startDateVal = endDateVal;endDateVal = temp;}switch (basis) {case 0: return basis0(startDateVal, endDateVal);case 1: return basis1(startDateVal, endDateVal);case 2: return basis2(startDateVal, endDateVal);case 3: return basis3(startDateVal, endDateVal);case 4: return basis4(startDateVal, endDateVal);}throw new IllegalStateException("cannot happen");}