private List<Column> parseColumns(Example table) { LOG.trace(ENTRY_WITH, table.toString()); Example headers = table.at(0, 1, 0); List<Column> columns; if (headers == null) { columns = new ArrayList<Column>(0); } else { columns = new ArrayList<Column>(headers.remainings()); for (int i = 0; i < headers.remainings(); i ++ ) { columns.add(parseColumn(headers.at(i))); } if (shouldStop(stats)) { headers.lastSibling().addSibling().annotate(Annotations.stopped()); } } LOG.trace(EXIT_WITH, columns); return columns; }
private Column[] parseColumns(Example table) { LOG.trace(ENTRY_WITH, table.toString()); Example headers = table.at(0, 1, 0); if (headers == null) { Column[] nullHeaderColumn = new Column[0]; LOG.trace(EXIT_WITH, nullHeaderColumn.toString()); return nullHeaderColumn; } Column[] arrayColumn = new Column[headers.remainings()]; for (int i = 0; i < headers.remainings(); i ++ ) { arrayColumn[i] = parseColumn(headers.at(i)); } if (shouldStop(stats)) { headers.lastSibling().addSibling().annotate(Annotations.stopped()); } LOG.trace(EXIT_WITH, arrayColumn.toString()); return arrayColumn; }
@Override public void interpret(Specification specification) { LOG.debug(ENTRY_WITH, specification.toString()); stats = new Statistics(); Example table = specification.nextExample(); columns = parseColumns(table); enterRowMessage = parseEnterRowMessage(table); for (Example row = table.at(0, 2); row != null && canContinue(stats); row = row.nextSibling()) { doRow(row); if (shouldStop(stats)) { row.firstChild().lastSibling().addSibling().annotate(Annotations.stopped()); } } specification.exampleDone(stats); LOG.debug(EXIT); }
row.addChild().annotate(Annotations.stopped()); row.addChild().annotate(Annotations.stopped()); example.lastSibling().addChild().annotate(Annotations.stopped()); break; example.addChild().annotate(Annotations.stopped()); example.addChild().annotate(Annotations.stopped()); example.addChild().annotate(Annotations.stopped());
@Override public void interpret(Specification specification) { LOG.debug(ENTRY_WITH, specification.toString()); stats = new Statistics(); Example table = specification.nextExample(); columns = parseColumns(table); bindColumnsTo(specification); parseMessages(); callBeforeTable(); for (Example row = table.at(0, 2); row != null && canContinue(stats); row = row.nextSibling()) { doRow(row); if (shouldStop(stats)) { row.firstChild().lastSibling().addSibling().annotate(Annotations.stopped()); } } callAfterTable(); specification.exampleDone(stats); LOG.debug(EXIT); }
row.addChild().annotate(Annotations.stopped()); break; row.addChild().annotate(Annotations.stopped()); break; example.lastSibling().addChild().annotate(Annotations.stopped()); break; example.addChild().annotate(Annotations.stopped()); example.addChild().annotate(Annotations.stopped()); example.addChild().annotate(Annotations.stopped());
private void execute(Table table) { while (table.hasMoreExamples() && canContinue(table.getStatistics())) { Example example = table.peek(); Row row = rowSelector.select(example); row.interpret(table); if (shouldStop(table.getStatistics())) { example.firstChild().lastSibling().addSibling().annotate(Annotations.stopped()); } } }