package net.sf.jasperreports.engine.fill;

public class JRFloatIncrementerFactory extends JRAbstractExtendedIncrementerFactory {
  protected static final Float ZERO = new Float(0.0F);
  
  private static JRFloatIncrementerFactory mainInstance = new JRFloatIncrementerFactory();
  
  public static JRFloatIncrementerFactory getInstance() {
    return mainInstance;
  }
  
  public JRExtendedIncrementer getExtendedIncrementer(byte calculation) {
    JRExtendedIncrementer incrementer = null;
    switch (calculation) {
      case 1:
        incrementer = JRFloatCountIncrementer.getInstance();
        return incrementer;
      case 2:
        incrementer = JRFloatSumIncrementer.getInstance();
        return incrementer;
      case 3:
        incrementer = JRFloatAverageIncrementer.getInstance();
        return incrementer;
      case 4:
      case 5:
        incrementer = JRComparableIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
        return incrementer;
      case 6:
        incrementer = JRFloatStandardDeviationIncrementer.getInstance();
        return incrementer;
      case 7:
        incrementer = JRFloatVarianceIncrementer.getInstance();
        return incrementer;
      case 10:
        incrementer = JRFloatDistinctCountIncrementer.getInstance();
        return incrementer;
    } 
    incrementer = JRDefaultIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
    return incrementer;
  }
}
