Package org.jacoco.core.analysis
Interface ICounter
- All Known Implementing Classes:
CounterImpl
,CounterImpl.Fix
,CounterImpl.Var
public interface ICounter
A counter holds the missed and the covered number of particular items like
classes, methods, branches or instructions.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Different values provided by a counter. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Status flag for no items (value is 0x00).static final int
Status flag when all items are covered (value is 0x02).static final int
Status flag when all items are not covered (value is 0x01).static final int
Status flag when items are partly covered (value is 0x03). -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the count of covered items.double
Calculates the ratio of covered to total count items.int
Returns the count of missed items.double
Calculates the ratio of missed to total count items.int
Returns the coverage status of this counter.int
Returns the total count of items.double
getValue
(ICounter.CounterValue value) Returns the counter value of the given type.
-
Field Details
-
EMPTY
static final int EMPTYStatus flag for no items (value is 0x00).- See Also:
-
NOT_COVERED
static final int NOT_COVEREDStatus flag when all items are not covered (value is 0x01).- See Also:
-
FULLY_COVERED
static final int FULLY_COVEREDStatus flag when all items are covered (value is 0x02).- See Also:
-
PARTLY_COVERED
static final int PARTLY_COVEREDStatus flag when items are partly covered (value is 0x03).- See Also:
-
-
Method Details
-
getValue
Returns the counter value of the given type.- Parameters:
value
- value type to return- Returns:
- counter value
-
getTotalCount
int getTotalCount()Returns the total count of items.- Returns:
- total count of items
-
getCoveredCount
int getCoveredCount()Returns the count of covered items.- Returns:
- count of covered items
-
getMissedCount
int getMissedCount()Returns the count of missed items.- Returns:
- count of missed items
-
getCoveredRatio
double getCoveredRatio()Calculates the ratio of covered to total count items. If total count items is 0 this method returns NaN.- Returns:
- ratio of covered to total count items
-
getMissedRatio
double getMissedRatio()Calculates the ratio of missed to total count items. If total count items is 0 this method returns NaN.- Returns:
- ratio of missed to total count items
-
getStatus
int getStatus()Returns the coverage status of this counter.- Returns:
- status of this line
- See Also:
-