ICounter.CounterValue| Modifier and Type | Field and Description |
|---|---|
static CounterImpl |
COUNTER_0_0
Constant for Counter with 0/0 values.
|
static CounterImpl |
COUNTER_0_1
Constant for Counter with 0/1 values.
|
static CounterImpl |
COUNTER_1_0
Constant for Counter with 1/0 values.
|
protected int |
covered
number of covered items
|
protected int |
missed
number of missed items
|
EMPTY, FULLY_COVERED, NOT_COVERED, PARTLY_COVERED| Modifier | Constructor and Description |
|---|---|
protected |
CounterImpl(int missed,
int covered)
Creates a new instance with the given numbers.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
getCoveredCount()
Returns the count of covered items.
|
double |
getCoveredRatio()
Calculates the ratio of covered to total count items.
|
static CounterImpl |
getInstance(ICounter counter)
Factory method to retrieve a clone of the given counter.
|
static CounterImpl |
getInstance(int missed,
int covered)
Factory method to retrieve a counter with the given number of items.
|
int |
getMissedCount()
Returns the count of missed items.
|
double |
getMissedRatio()
Calculates the ratio of missed to total count items.
|
int |
getStatus()
Returns the coverage status of this counter.
|
int |
getTotalCount()
Returns the total count of items.
|
double |
getValue(ICounter.CounterValue value)
Returns the counter value of the given type.
|
int |
hashCode() |
CounterImpl |
increment(ICounter counter)
Returns a counter with values incremented by the numbers of the given
counter.
|
abstract CounterImpl |
increment(int missed,
int covered)
Returns a counter with values incremented by the given numbers.
|
String |
toString() |
public static final CounterImpl COUNTER_0_0
public static final CounterImpl COUNTER_1_0
public static final CounterImpl COUNTER_0_1
protected int missed
protected int covered
protected CounterImpl(int missed,
int covered)
missed - number of missed itemscovered - number of covered itemspublic static CounterImpl getInstance(int missed, int covered)
missed - number of missed itemscovered - number of covered itemspublic static CounterImpl getInstance(ICounter counter)
counter - counter to copypublic CounterImpl increment(ICounter counter)
counter - number of additional total and covered itemspublic abstract CounterImpl increment(int missed, int covered)
missed - number of missed itemscovered - number of covered itemspublic double getValue(ICounter.CounterValue value)
ICounterpublic int getTotalCount()
ICountergetTotalCount in interface ICounterpublic int getCoveredCount()
ICountergetCoveredCount in interface ICounterpublic int getMissedCount()
ICountergetMissedCount in interface ICounterpublic double getCoveredRatio()
ICountergetCoveredRatio in interface ICounterpublic double getMissedRatio()
ICountergetMissedRatio in interface ICounterpublic int getStatus()
ICountergetStatus in interface ICounterICounter.EMPTY,
ICounter.NOT_COVERED,
ICounter.PARTLY_COVERED,
ICounter.FULLY_COVEREDCopyright © 2024. All rights reserved.