public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) { if (args.length < 2 || args.length > 3) {return ErrorEval.VALUE_INVALID;}int srcCellRow = ec.getRowIndex();int srcCellCol = ec.getColumnIndex();double start, end;double[] holidays;try {start = this.evaluator.evaluateDateArg(args[0], srcCellRow, srcCellCol);end = this.evaluator.evaluateDateArg(args[1], srcCellRow, srcCellCol);if (start > end) {return ErrorEval.NAME_INVALID;}ValueEval holidaysCell = args.length == 3 ? args[2] : null;holidays = this.evaluator.evaluateDatesArg(holidaysCell, srcCellRow, srcCellCol);return new NumberEval(WorkdayCalculator.instance.calculateWorkdays(start, end, holidays));} catch (EvaluationException e) {return ErrorEval.VALUE_INVALID;}}
public ValueEval Evaluate(ValueEval[] args, OperationEvaluationContext ec){if (args.Length < 2 || args.Length > 3){return ErrorEval.VALUE_INVALID;}int srcCellRow = ec.RowIndex;int srcCellCol = ec.ColumnIndex;double start, end;double[] holidays;try{start = this.evaluator.EvaluateDateArg(args[0], srcCellRow, srcCellCol);end = this.evaluator.EvaluateDateArg(args[1], srcCellRow, srcCellCol);if (start > end){return ErrorEval.NAME_INVALID;}ValueEval holidaysCell = args.Length == 3 ? args[2] : null;holidays = this.evaluator.EvaluateDatesArg(holidaysCell, srcCellRow, srcCellCol);return new NumberEval(WorkdayCalculator.instance.CalculateWorkdays(start, end, holidays));}catch (EvaluationException){return ErrorEval.VALUE_INVALID;}}