public int compare(final ICoverageNode n1, final ICoverageNode n2) { final ICounter c1 = n1.getCounter(entity); final ICounter c2 = n2.getCounter(entity); return counterComparator.compare(c1, c2); }
private void cell(final HTMLElement td, final ICoverageNode node) throws IOException { final int value = getValue(node.getCounter(entity)); td.text(integerFormat.format(value)); }
String check(final ICoverageNode node) { final double d = node.getCounter(entity).getValue(value); if (Double.isNaN(d)) { return null; } final BigDecimal bd = BigDecimal.valueOf(d); if (minimum != null && minimum.compareTo(bd) > 0) { return message("minimum", bd, minimum, RoundingMode.FLOOR); } if (maximum != null && maximum.compareTo(bd) < 0) { return message("maximum", bd, maximum, RoundingMode.CEILING); } return null; }
public boolean init(final List<? extends ITableItem> items, final ICoverageNode total) { this.max = 0; for (final ITableItem item : items) { final int count = item.getNode().getCounter(entity).getTotalCount(); if (count > this.max) { this.max = count; } } return true; }
public boolean init(final List<? extends ITableItem> items, final ICoverageNode total) { for (final ITableItem i : items) { if (i.getNode().getCounter(entity).getTotalCount() > 0) { return true; } } return false; }
public void footer(final HTMLElement td, final ICoverageNode total, final Resources resources, final ReportOutputFolder base) throws IOException { final ICounter counter = total.getCounter(entity); td.text(integerFormat.format(counter.getMissedCount())); td.text(" of "); td.text(integerFormat.format(counter.getTotalCount())); }
/** * Writes all non-zero counters of the given node. * * @param node * node to retrieve counters from * @param parent * container for the counter elements * @throws IOException * if XML can't be written to the underlying output */ public static void writeCounters(final ICoverageNode node, final ReportElement parent) throws IOException { for (final CounterEntity counterEntity : CounterEntity.values()) { final ICounter counter = node.getCounter(counterEntity); if (counter.getTotalCount() > 0) { parent.counter(counterEntity, counter); } } }
public void item(final HTMLElement td, final ITableItem item, final Resources resources, final ReportOutputFolder base) throws IOException { if (max > 0) { final ICounter counter = item.getNode().getCounter(entity); final int missed = counter.getMissedCount(); bar(td, missed, Resources.REDBAR, resources, base); final int covered = counter.getCoveredCount(); bar(td, covered, Resources.GREENBAR, resources, base); } }
private void cell(final HTMLElement td, final ICoverageNode node) throws IOException { final ICounter counter = node.getCounter(entity); final int total = counter.getTotalCount(); if (total == 0) { td.text("n/a"); } else { td.text(format(counter.getCoveredRatio())); } }