package net.sf.jasperreports.engine.fill;

import java.math.BigDecimal;

public class JRBigDecimalIncrementerFactory extends JRAbstractExtendedIncrementerFactory {
  protected static final BigDecimal ZERO = new BigDecimal("0");
  
  protected static final BigDecimal ONE = new BigDecimal("1");
  
  private static JRBigDecimalIncrementerFactory mainInstance = new JRBigDecimalIncrementerFactory();
  
  public static JRBigDecimalIncrementerFactory getInstance() {
    return mainInstance;
  }
  
  public JRExtendedIncrementer getExtendedIncrementer(byte calculation) {
    JRExtendedIncrementer incrementer = null;
    switch (calculation) {
      case 1:
        incrementer = JRBigDecimalCountIncrementer.getInstance();
        return incrementer;
      case 2:
        incrementer = JRBigDecimalSumIncrementer.getInstance();
        return incrementer;
      case 3:
        incrementer = JRBigDecimalAverageIncrementer.getInstance();
        return incrementer;
      case 4:
      case 5:
        incrementer = JRComparableIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
        return incrementer;
      case 6:
        incrementer = JRBigDecimalStandardDeviationIncrementer.getInstance();
        return incrementer;
      case 7:
        incrementer = JRBigDecimalVarianceIncrementer.getInstance();
        return incrementer;
      case 10:
        incrementer = JRBigDecimalDistinctCountIncrementer.getInstance();
        return incrementer;
    } 
    incrementer = JRDefaultIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
    return incrementer;
  }
}
