@Override
public Object getDataValue(final int colIndex, final int rowIndex) {
if (colIndex == 3) {
Object result = this.valueCache.getCalculatedValue(colIndex,
rowIndex, true, new ICalculator() {
@Override
public Object executeCalculation() {
// calculate the sum
int colTwo = (Integer) getDataValue(1, rowIndex);
int colThree = (Integer) getDataValue(2,
rowIndex);
// add some delay
try {
Thread.sleep(500);
} catch (InterruptedException e) {}
return colTwo + colThree;
}
});
return result == null ? 0 : result;
} else if (colIndex == 4) {
Object result = this.valueCache.getCalculatedValue(colIndex,
rowIndex, true, new ICalculator() {
@Override
public Object executeCalculation() {
// calculate the percentage
int colOne = (Integer) getDataValue(0, rowIndex);
int colTwo = (Integer) getDataValue(1, rowIndex);