package net.sf.jasperreports.engine.fill;

public class JRShortIncrementerFactory extends JRAbstractExtendedIncrementerFactory {
  protected static final Short ZERO = new Short((short)0);
  
  private static JRShortIncrementerFactory mainInstance = new JRShortIncrementerFactory();
  
  public static JRShortIncrementerFactory getInstance() {
    return mainInstance;
  }
  
  public JRExtendedIncrementer getExtendedIncrementer(byte calculation) {
    JRExtendedIncrementer incrementer = null;
    switch (calculation) {
      case 1:
        incrementer = JRShortCountIncrementer.getInstance();
        return incrementer;
      case 2:
        incrementer = JRShortSumIncrementer.getInstance();
        return incrementer;
      case 3:
        incrementer = JRShortAverageIncrementer.getInstance();
        return incrementer;
      case 4:
      case 5:
        incrementer = JRComparableIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
        return incrementer;
      case 6:
        incrementer = JRShortStandardDeviationIncrementer.getInstance();
        return incrementer;
      case 7:
        incrementer = JRShortVarianceIncrementer.getInstance();
        return incrementer;
      case 10:
        incrementer = JRShortDistinctCountIncrementer.getInstance();
        return incrementer;
    } 
    incrementer = JRDefaultIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
    return incrementer;
  }
}
