HSSFCell cell = (HSSFCell)it.next();
if(cell.getCellType() != HSSFCell.CELL_TYPE_FORMULA) {
continue;
}
FormulaRecordAggregate record = (FormulaRecordAggregate) cell.getCellValueRecord();
FormulaRecord r = record.getFormulaRecord();
List ptgs = r.getParsedExpression();
String cellRef = new CellReference(row.getRowNum(), cell.getCellNum(), false, false).formatAsString();
if(false && cellRef.equals("BP24")) { // TODO - replace System.out.println()s with asserts
System.out.print(cellRef);
System.out.println(" - has " + r.getNumberOfExpressionTokens()
+ " ptgs over " + r.getExpressionLength() + " tokens:");
for(int i=0; i<ptgs.size(); i++) {
String c = ptgs.get(i).getClass().toString();
System.out.println("\t" + c.substring(c.lastIndexOf('.')+1) );
}
System.out.println("-> " + cell.getCellFormula());