protected internal virtual double?getCollectResultValue(TypedValue collectResultValue) { // the built-in collect aggregators return only numbers if (collectResultValue is IntegerValue) { return(((IntegerValue)collectResultValue).Value.doubleValue()); } else if (collectResultValue is LongValue) { return(((LongValue)collectResultValue).Value.doubleValue()); } else if (collectResultValue is DoubleValue) { return(((DoubleValue)collectResultValue).Value); } else { throw LOG.collectResultValueOfUnsupportedTypeException(collectResultValue); } }