|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sonar.api.measures.CountDistributionBuilder
public class CountDistributionBuilder
Utility to build a distribution based on discrete values
An example of usage : you wish to record the number of violations for each level of rules priority
| Constructor Summary | |
|---|---|
CountDistributionBuilder(Metric metric)
Creates an empty CountDistributionBuilder for a specified metric |
|
| Method Summary | |
|---|---|
CountDistributionBuilder |
add(Measure measure)
Adds an existing Distribution to the current one. |
CountDistributionBuilder |
add(Object value)
Increments an entry by one |
CountDistributionBuilder |
add(Object value,
int count)
Increments an entry |
CountDistributionBuilder |
addZero(Object value)
Adds an entry without a zero count if it does not exist |
Measure |
build()
Shortcut for build(true) |
Measure |
build(boolean allowEmptyData)
Used to build a measure from the current object |
CountDistributionBuilder |
clear()
Resets all entries to zero |
boolean |
isEmpty()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CountDistributionBuilder(Metric metric)
metric - the metric| Method Detail |
|---|
public CountDistributionBuilder add(Object value,
int count)
value - the value that should be incrementedcount - the number by which to increment
public CountDistributionBuilder add(Object value)
value - the value that should be incremented
public CountDistributionBuilder addZero(Object value)
value - the entry to be added
public CountDistributionBuilder add(Measure measure)
measure - the measure to add to the current one
public boolean isEmpty()
public CountDistributionBuilder clear()
public Measure build()
build(true)
build in interface MeasureBuilderpublic Measure build(boolean allowEmptyData)
allowEmptyData - should be built if current object is empty
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||