|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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<String> metric)
|
|
RangeDistributionBuilder(Metric<String> metric,
Number[] bottomLimits)
RangeDistributionBuilder for a metric and a defined range Each entry is initialized at zero |
|
| Method Summary | |
|---|---|
RangeDistributionBuilder |
add(Measure<String> 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<String> |
build()
Shortcut for build(true) |
Measure<String> |
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<String> metric,
Number[] bottomLimits)
metric - the metric to record the measure againstbottomLimits - the bottom limits of ranges to be usedpublic RangeDistributionBuilder(Metric<String> 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(@Nullable
Measure<String> measure)
measure - the measure to add to the current one
public RangeDistributionBuilder clear()
public boolean isEmpty()
public Measure<String> build()
build(true)
build in interface MeasureBuilderpublic Measure<String> 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 | |||||||||