first commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package net.sf.jasperreports.engine.fill;
|
||||
|
||||
class JRByteSumIncrementer extends JRAbstractExtendedIncrementer {
|
||||
private static JRByteSumIncrementer mainInstance = new JRByteSumIncrementer();
|
||||
|
||||
public static JRByteSumIncrementer getInstance() {
|
||||
return mainInstance;
|
||||
}
|
||||
|
||||
public Object increment(JRCalculable variable, Object expressionValue, AbstractValueProvider valueProvider) {
|
||||
Number value = (Number)variable.getIncrementedValue();
|
||||
Number newValue = (Number)expressionValue;
|
||||
if (newValue == null) {
|
||||
if (variable.isInitialized())
|
||||
return null;
|
||||
return value;
|
||||
}
|
||||
if (value == null || variable.isInitialized())
|
||||
value = JRByteIncrementerFactory.ZERO;
|
||||
return new Byte((byte)(value.byteValue() + newValue.byteValue()));
|
||||
}
|
||||
|
||||
public Object initialValue() {
|
||||
return JRByteIncrementerFactory.ZERO;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user