package net.sf.jasperreports.engine.fill;

public class JRIntegerIncrementerFactory extends JRAbstractExtendedIncrementerFactory {
  protected static final Integer ZERO = new Integer(0);
  
  private static JRIntegerIncrementerFactory mainInstance = new JRIntegerIncrementerFactory();
  
  public static JRIntegerIncrementerFactory getInstance() {
    return mainInstance;
  }
  
  public JRExtendedIncrementer getExtendedIncrementer(byte calculation) {
    JRExtendedIncrementer incrementer = null;
    switch (calculation) {
      case 1:
        incrementer = JRIntegerCountIncrementer.getInstance();
        return incrementer;
      case 2:
        incrementer = JRIntegerSumIncrementer.getInstance();
        return incrementer;
      case 3:
        incrementer = JRIntegerAverageIncrementer.getInstance();
        return incrementer;
      case 4:
      case 5:
        incrementer = JRComparableIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
        return incrementer;
      case 6:
        incrementer = JRIntegerStandardDeviationIncrementer.getInstance();
        return incrementer;
      case 7:
        incrementer = JRIntegerVarianceIncrementer.getInstance();
        return incrementer;
      case 10:
        incrementer = JRIntegerDistinctCountIncrementer.getInstance();
        return incrementer;
    } 
    incrementer = JRDefaultIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
    return incrementer;
  }
}
