void commit() { if (attList == null || !attList.hasOption("autowidth")) { double width = 100.0 / count; ColumnContext col = rootColumn; for (int i = 0; i < count; i++) { col.width = width; col = col.next; } } }
void addCell(int lineNumber) { // line number relative to table checkImplicitHeader(lineNumber); // add cell if (rootCell == null) { rootCell = CellContext.empty(); currentCell = rootCell; lineNumberStart = lineNumber; } else { currentCell = CellContext.withParent(currentCell); } // add column if (lineNumber == lineNumberStart) { count++; if (rootColumn == null) { rootColumn = ColumnContext.empty(); currentColumn = rootColumn; } else { currentColumn = ColumnContext.withParent(currentColumn); } } }
static ColumnContext withParent(ColumnContext parent) { final ColumnContext column = new ColumnContext(); parent.next = column; return column; }