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 enumDifferent values provided by a counter. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intStatus flag for no items (value is 0x00).static final intStatus flag when all items are covered (value is 0x02).static final intStatus flag when all items are not covered (value is 0x01).static final intStatus flag when items are partly covered (value is 0x03). -
Method Summary
Modifier and TypeMethodDescriptionintReturns the count of covered items.doubleCalculates the ratio of covered to total count items.intReturns the count of missed items.doubleCalculates the ratio of missed to total count items.intReturns the coverage status of this counter.intReturns the total count of items.doublegetValue(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:
-