package net.sf.jasperreports.engine.fill;

class JRDefaultNothingIncrementer extends JRAbstractExtendedIncrementer {
  private static JRDefaultNothingIncrementer mainInstance = new JRDefaultNothingIncrementer();
  
  public static JRDefaultNothingIncrementer getInstance() {
    return mainInstance;
  }
  
  public Object increment(JRCalculable variable, Object expressionValue, AbstractValueProvider valueProvider) {
    return expressionValue;
  }
  
  public Object combine(JRCalculable calculable, JRCalculable calculableValue, AbstractValueProvider valueProvider) {
    if (!calculableValue.isInitialized())
      return calculableValue.getValue(); 
    if (!calculable.isInitialized())
      return calculable.getValue(); 
    return null;
  }
  
  public Object initialValue() {
    return null;
  }
}
