package net.sf.jasperreports.engine.fill;

public class JRByteIncrementerFactory extends JRAbstractExtendedIncrementerFactory {
  protected static final Byte ZERO = new Byte((byte)0);
  
  private static JRByteIncrementerFactory mainInstance = new JRByteIncrementerFactory();
  
  public static JRByteIncrementerFactory getInstance() {
    return mainInstance;
  }
  
  public JRExtendedIncrementer getExtendedIncrementer(byte calculation) {
    JRExtendedIncrementer incrementer = null;
    switch (calculation) {
      case 1:
        incrementer = JRByteCountIncrementer.getInstance();
        return incrementer;
      case 2:
        incrementer = JRByteSumIncrementer.getInstance();
        return incrementer;
      case 3:
        incrementer = JRByteAverageIncrementer.getInstance();
        return incrementer;
      case 4:
      case 5:
        incrementer = JRComparableIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
        return incrementer;
      case 6:
        incrementer = JRByteStandardDeviationIncrementer.getInstance();
        return incrementer;
      case 7:
        incrementer = JRByteVarianceIncrementer.getInstance();
        return incrementer;
      case 10:
        incrementer = JRByteDistinctCountIncrementer.getInstance();
        return incrementer;
    } 
    incrementer = JRDefaultIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
    return incrementer;
  }
}
