org.jxls.functions.BigDecimalSummarizerBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jxls-core Show documentation
Show all versions of jxls-core Show documentation
Small library for Excel generation based on XLS templates
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;
}
};
}
}