Class AbstractMeasurementSource
- java.lang.Object
-
- com.bw.jtools.profiling.measurement.AbstractMeasurementSource
-
- Direct Known Subclasses:
SystemNanoTime,ThreadExecutionTime
public abstract class AbstractMeasurementSource extends java.lang.ObjectProducer interface for Measurement values.
-
-
Field Summary
Fields Modifier and Type Field Description static AbstractMeasurementSourcecurrentSourceThe currently used measurement source.
-
Constructor Summary
Constructors Constructor Description AbstractMeasurementSource()
-
Method Summary
Modifier and Type Method Description static java.lang.Stringformat(java.text.NumberFormat nf, MeasurementValue value)Convenience method as replacement for currentSource.formatValue.abstract java.lang.StringformatValue(java.text.NumberFormat nf, MeasurementValue value)Returns the formatted value.abstract MeasurementValuegetMeasurement()Returns a instance that reflects the current value.static MeasurementValuemeasure()Convenience method as replacement for currentSource.getMeasurement.
-
-
-
Field Detail
-
currentSource
public static AbstractMeasurementSource currentSource
The currently used measurement source.
-
-
Method Detail
-
measure
public static MeasurementValue measure()
Convenience method as replacement for currentSource.getMeasurement.- Returns:
- The current value.
-
format
public static java.lang.String format(java.text.NumberFormat nf, MeasurementValue value)Convenience method as replacement for currentSource.formatValue.- Parameters:
nf- The number format to use.value- The value to format.- Returns:
- The formatted value.
-
getMeasurement
public abstract MeasurementValue getMeasurement()
Returns a instance that reflects the current value. The first dimension have to be strictly monotone.- Returns:
- The current value.
-
formatValue
public abstract java.lang.String formatValue(java.text.NumberFormat nf, MeasurementValue value)Returns the formatted value.- Parameters:
nf- The number format to use.value- The value to format.- Returns:
- The formatted value.
-
-