Set all = new HashSet();
for (Iterator i = blocks.iterator(); i.hasNext(); ) {
Box b = (Box)i.next();
if (b instanceof TableCellBox) {
TableCellBox cell = (TableCellBox)b;
if (cell.hasCollapsedPaintingBorder()) {
List borders = (List)cellBordersByTable.get(cell.getTable());
if (borders == null) {
borders = new ArrayList();
cellBordersByTable.put(cell.getTable(), borders);
}
triggerCellsByTable.put(cell.getTable(), cell);
cell.addCollapsedBorders(all, borders);
}
}
}
if (triggerCellsByTable.size() == 0) {
return null;
} else {
Map result = new HashMap();
for (Iterator i = triggerCellsByTable.values().iterator(); i.hasNext(); ) {
TableCellBox cell = (TableCellBox)i.next();
List borders = (List)cellBordersByTable.get(cell.getTable());
Collections.sort(borders);
result.put(cell, borders);
}
return result;