All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jxls.functions.DoubleSummarizerBuilder Maven / Gradle / Ivy

The newest version!
package org.jxls.functions;

public class DoubleSummarizerBuilder implements SummarizerBuilder {

    @Override
    public Summarizer build() {
        return new Summarizer() {
            private double sum = 0;

            @Override
            public void add(Object number) {
                if (number != null) {
                    sum += ((Double) number).doubleValue();
                }
            }

            @Override
            public Double getSum() {
                return Double.valueOf(sum);
            }
        };
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy