/** * Fallback to reflection if the call-site will not work or did not work * @param array array of items to reduce by * @param object function object * @param <T> type of function object. * @return result */ private static <T> long reduceByR( final long[] array, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); long sum = 0; for ( long v : array ) { sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Fallback to reflection if the call-site will not work or did not work * @param array array of items to reduce by * @param object function object * @param <T> type of function object. * @return result */ private static <T> long reduceByR( final int[] array, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); long sum = 0; for ( int v : array ) { sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param methodName name of method * @param <T> type of function * @return reduction */ private static <T> long reduceByR( final long[] array, T object, String methodName ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object, methodName); long sum = 0; for ( long v : array ) { sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param <T> type of function * @return reduction */ private static <T> long reduceByR( final long[] array, int length, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); long sum = 0; for (int index=0; index< length; index++) { long v = array[index]; sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param methodName name of method * @param <T> type of function * @return reduction */ private static <T> long reduceByR( final int[] array, T object, String methodName ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object, methodName); long sum = 0; for ( int v : array ) { sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param methodName name of method * @param <T> type of function * @return reduction */ private static <T> double reduceByR( final double[] array, T object, String methodName ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object, methodName); double sum = 0; for ( double v : array ) { sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param <T> type of function * @return reduction */ private static <T> double reduceByR( final float[] array, int length, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); double sum = 0; for (int index=0; index< length; index++) { float v = array[index]; sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param <T> type of function * @return reduction */ private static <T> double reduceByR( final float[] array, int length, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); double sum = 0; for (int index=0; index< length; index++) { float v = array[index]; sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Fallback to reflection if the call-site will not work or did not work * @param array array of items to reduce by * @param object function object * @param <T> type of function object. * @return reduction */ private static <T> double reduceByR( final double[] array, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); double sum = 0; for ( double v : array ) { sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Fallback to reflection if the call-site will not work or did not work * @param array array of items to reduce by * @param object function object * @param <T> type of function object. * @return reduction */ private static <T> double reduceByR( final double[] array, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); double sum = 0; for ( double v : array ) { sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Fallback to reflection if the call-site will not work or did not work * @param array array of items to reduce by * @param object function object * @param <T> type of function object. * @return result */ private static <T> double reduceByR( final float[] array, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); double sum = 0; for ( float v : array ) { sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Fallback to reflection if the call-site will not work or did not work * @param array array of items to reduce by * @param object function object * @param <T> type of function object. * @return result */ private static <T> long reduceByR( final long[] array, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); long sum = 0; for ( long v : array ) { sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Fallback to reflection if the call-site will not work or did not work * @param array array of items to reduce by * @param object function object * @param <T> type of function object. * @return result */ private static <T> long reduceByR( final int[] array, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); long sum = 0; for ( int v : array ) { sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Fallback to reflection if the call-site will not work or did not work * @param array array of items to reduce by * @param object function object * @param <T> type of function object. * @return result */ private static <T> double reduceByR( final float[] array, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); double sum = 0; for ( float v : array ) { sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param methodName name of method * @param <T> type of function * @return reduction */ private static <T> double reduceByR( final double[] array, int length, T object, String methodName ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object, methodName); double sum = 0; for (int index=0; index< length; index++) { double v = array[index]; sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param methodName name of method * @param <T> type of function * @return reduction */ private static <T> long reduceByR( final int[] array, T object, String methodName ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object, methodName); long sum = 0; for ( int v : array ) { sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param <T> type of function * @return reduction */ private static <T> double reduceByR( final double[] array, int length, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); double sum = 0; for (int index=0; index< length; index++) { double v = array[index]; sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param <T> type of function * @return reduction */ private static <T> long reduceByR( final int[] array, int length, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); long sum = 0; for (int index=0; index< length; index++) { int v = array[index]; sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param <T> type of function * @return reduction */ private static <T> long reduceByR( final long[] array, int length, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); long sum = 0; for (int index=0; index< length; index++) { long v = array[index]; sum = (long) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return handle(Long.class, throwable, "Unable to perform reduceBy"); } }
/** * Reflection based reduce by. * @param array array of items to reduce by * @param object function * @param <T> type of function * @return reduction */ private static <T> double reduceByR( final double[] array, int length, T object ) { try { Method method = Invoker.invokeReducerLongIntReturnLongMethod(object); double sum = 0; for (int index=0; index< length; index++) { double v = array[index]; sum = (double) method.invoke(object, sum, v); } return sum; } catch (Throwable throwable) { return Exceptions.handle(Long.class, throwable, "Unable to perform reduceBy"); } }