@Override public AccumulatedType accumulate(AccumulatedType accumulated, InType in) { return accumulator.accumulate(accumulated, in); } };
@Override public OutType accumulate(OutType accumulated, InType in) { return accumulator.accumulate(accumulated, fn.apply(in)); } }
@Override public OutType accumulate(OutType accumulated, T in) { if (pred.apply(in)) { return accumulator.accumulate(accumulated, in); } return accumulated; } }
@Override public <OutType> OutType accumulate(OutType initValue, final Accumulator<OutType, T> fn) { IterType iterator = maker.make(); try { while (iterator.hasNext()) { initValue = fn.accumulate(initValue, iterator.next()); } } catch (Throwable t) { try { maker.cleanup(iterator); } catch (Exception e) { t.addSuppressed(e); } throw t; } maker.cleanup(iterator); return initValue; }
@Override public T accumulate(T prevValue, T t) { if (!accumulatedSomething) { accumulatedSomething = true; } if (prevValue == null) { return mergeFn.apply(t, null); } if (ordering.compare(prevValue, t) == 0) { return mergeFn.apply(prevValue, t); } retVal = accumulator.accumulate(retVal, prevValue); return t; } }
@Override public AccumulatedType accumulate(AccumulatedType accumulated, InType in) { return accumulator.accumulate(accumulated, in); } };
@Override public OutType accumulate(OutType accumulated, InType in) { return accumulator.accumulate(accumulated, fn.apply(in)); } }
@Override public OutType accumulate(OutType accumulated, T in) { if (pred.apply(in)) { return accumulator.accumulate(accumulated, in); } return accumulated; } }
@Override public <OutType> OutType accumulate(OutType initValue, final Accumulator<OutType, T> fn) { IterType iterator = maker.make(); try { while (iterator.hasNext()) { initValue = fn.accumulate(initValue, iterator.next()); } } catch (Throwable t) { try { maker.cleanup(iterator); } catch (Exception e) { t.addSuppressed(e); } throw t; } maker.cleanup(iterator); return initValue; }
@Override public T accumulate(T prevValue, T t) { if (!accumulatedSomething) { accumulatedSomething = true; } if (prevValue == null) { return mergeFn.apply(t, null); } if (ordering.compare(prevValue, t) == 0) { return mergeFn.apply(prevValue, t); } retVal = accumulator.accumulate(retVal, prevValue); return t; } }