package net.sf.jasperreports.engine.fill;

public class JRLongIncrementerFactory extends JRAbstractExtendedIncrementerFactory {
  protected static final Long ZERO = new Long(0L);
  
  private static JRLongIncrementerFactory mainInstance = new JRLongIncrementerFactory();
  
  public static JRLongIncrementerFactory getInstance() {
    return mainInstance;
  }
  
  public JRExtendedIncrementer getExtendedIncrementer(byte calculation) {
    JRExtendedIncrementer incrementer = null;
    switch (calculation) {
      case 1:
        incrementer = JRLongCountIncrementer.getInstance();
        return incrementer;
      case 2:
        incrementer = JRLongSumIncrementer.getInstance();
        return incrementer;
      case 3:
        incrementer = JRLongAverageIncrementer.getInstance();
        return incrementer;
      case 4:
      case 5:
        incrementer = JRComparableIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
        return incrementer;
      case 6:
        incrementer = JRLongStandardDeviationIncrementer.getInstance();
        return incrementer;
      case 7:
        incrementer = JRLongVarianceIncrementer.getInstance();
        return incrementer;
      case 10:
        incrementer = JRLongDistinctCountIncrementer.getInstance();
        return incrementer;
    } 
    incrementer = JRDefaultIncrementerFactory.getInstance().getExtendedIncrementer(calculation);
    return incrementer;
  }
}
