Class BarColumn
java.lang.Object
org.jacoco.report.internal.html.table.BarColumn
- All Implemented Interfaces:
IColumnRenderer
Column with a graphical bar that represents the total amount of items in with
length, and the coverage ratio with a red/green sections. The implementation
is stateful, instances must not be used in parallel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Comparator<ITableItem>
private final ICoverageNode.CounterEntity
private final NumberFormat
private int
private static final int
-
Constructor Summary
ConstructorsConstructorDescriptionBarColumn
(ICoverageNode.CounterEntity entity, Locale locale) Creates a new column that is based on theICounter
for the given entity. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
bar
(HTMLElement td, int count, String image, Resources resources, ReportOutputFolder base) void
footer
(HTMLElement td, ICoverageNode total, Resources resources, ReportOutputFolder base) Renders the footer for this column.Returns the comparator to sort this table column.boolean
init
(List<? extends ITableItem> items, ICoverageNode total) Initializes the column before any output method is called.void
item
(HTMLElement td, ITableItem item, Resources resources, ReportOutputFolder base) Renders a single item in this column.
-
Field Details
-
WIDTH
private static final int WIDTH- See Also:
-
entity
-
integerFormat
-
max
private int max -
comparator
-
-
Constructor Details
-
BarColumn
Creates a new column that is based on theICounter
for the given entity.- Parameters:
entity
- counter entity for visualizationlocale
- locale for rendering numbers
-
-
Method Details
-
init
Description copied from interface:IColumnRenderer
Initializes the column before any output method is called.- Specified by:
init
in interfaceIColumnRenderer
- Parameters:
items
- all items that will be displayed in the tabletotal
- the summary of all coverage data items in the table- Returns:
true
if the column should be visible
-
item
public void item(HTMLElement td, ITableItem item, Resources resources, ReportOutputFolder base) throws IOException Description copied from interface:IColumnRenderer
Renders a single item in this column.- Specified by:
item
in interfaceIColumnRenderer
- Parameters:
td
- the parent table cellitem
- the item to displayresources
- static resources that might be referencedbase
- base folder of the table- Throws:
IOException
- in case of IO problems with the element output
-
bar
private void bar(HTMLElement td, int count, String image, Resources resources, ReportOutputFolder base) throws IOException - Throws:
IOException
-
getComparator
Description copied from interface:IColumnRenderer
Returns the comparator to sort this table column.- Specified by:
getComparator
in interfaceIColumnRenderer
- Returns:
- comparator for this column
-