|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.measures.RangeDistributionBuilder
public class RangeDistributionBuilder
Utility to build a distribution based on defined ranges
An example of usage : you wish to record the percentage of lines of code that belong to method with pre-defined ranges of complexity.
Constructor Summary | |
---|---|
RangeDistributionBuilder(Metric metric)
|
|
RangeDistributionBuilder(Metric metric,
Number[] bottomLimits)
RangeDistributionBuilder for a metric and a defined range Each entry is initialized at zero |
Method Summary | |
---|---|
RangeDistributionBuilder |
add(Measure measure)
Adds an existing Distribution to the current one. |
RangeDistributionBuilder |
add(Number value)
Increments an entry by 1 |
RangeDistributionBuilder |
add(Number value,
int count)
Increments an entry |
Measure |
build()
Shortcut for build(true) |
Measure |
build(boolean allowEmptyData)
Used to build a measure from the current object |
RangeDistributionBuilder |
clear()
Resets all entries to zero |
Number[] |
getBottomLimits()
Gives the bottom limits of ranges used |
boolean |
isEmpty()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RangeDistributionBuilder(Metric metric, Number[] bottomLimits)
metric
- the metric to record the measure againstbottomLimits
- the bottom limits of ranges to be usedpublic RangeDistributionBuilder(Metric metric)
Method Detail |
---|
public Number[] getBottomLimits()
public RangeDistributionBuilder add(Number value)
value
- the value to use to pick the entry to increment
public RangeDistributionBuilder add(Number value, int count)
value
- the value to use to pick the entry to incrementcount
- the number by which to increment
public RangeDistributionBuilder add(Measure measure)
measure
- the measure to add to the current one
public RangeDistributionBuilder clear()
public boolean isEmpty()
public Measure build()
build(true)
build
in interface MeasureBuilder
public 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 |