/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ /** * * @author Uwe Schmidt * * Summe aller Zahlen in einem Container */ //-------------------- public class IntegerSum extends Accumulate { //-------------------- // die Variable // zu Akkumulieren des Ergebnisses private int result = 0; //-------------------- public void process(Integer element) { // auto unboxing result += element; } //-------------------- public Integer getResult() { // auto boxing return result; } }