org.sonar.api.measures
Class MeasureUtils

java.lang.Object
  extended by org.sonar.api.measures.MeasureUtils

public final class MeasureUtils
extends Object

Since:
1.10

Method Summary
static Double getValue(Measure measure, Double defaultValue)
          Get the measure value.
static boolean hasData(Measure measure)
           
static boolean hasValue(Measure measure)
           
static boolean haveValues(Measure... measures)
          Return true if all measures have numeric value.
static Double sum(boolean zeroIfNone, Collection<Measure> measures)
           
static Double sum(boolean zeroIfNone, Measure... measures)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

haveValues

public static boolean haveValues(Measure... measures)
Return true if all measures have numeric value.


getValue

public static Double getValue(Measure measure,
                              Double defaultValue)
Get the measure value. Return defaultValue if measure is null or has no values.


hasValue

public static boolean hasValue(Measure measure)

hasData

public static boolean hasData(Measure measure)

sum

public static Double sum(boolean zeroIfNone,
                         Collection<Measure> measures)

sum

public static Double sum(boolean zeroIfNone,
                         Measure... measures)


Copyright © 2009 SonarSource SA. All Rights Reserved.