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.
|
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 int getTotalCount()
ICounter
getTotalCount
in interface ICounter
public int getCoveredCount()
ICounter
getCoveredCount
in interface ICounter
public int getMissedCount()
ICounter
getMissedCount
in interface ICounter
public double getCoveredRatio()
ICounter
getCoveredRatio
in interface ICounter
public double getMissedRatio()
ICounter
getMissedRatio
in interface ICounter
public int getStatus()
ICounter
getStatus
in interface ICounter
ICounter.EMPTY
,
ICounter.NOT_COVERED
,
ICounter.PARTLY_COVERED
,
ICounter.FULLY_COVERED
Copyright © 2012. All Rights Reserved.