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

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

The newest version!
package org.jxls.functions;

import java.math.BigDecimal;

public class BigDecimalSummarizerBuilder implements SummarizerBuilder {

    @Override
    public Summarizer build() {
        return new Summarizer() {
            private BigDecimal sum = BigDecimal.ZERO;

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

            }

            @Override
            public BigDecimal getSum() {
                return sum;
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy