Class AbstractMeasurementSource

  • Direct Known Subclasses:
    SystemNanoTime, ThreadExecutionTime

    public abstract class AbstractMeasurementSource
    extends java.lang.Object
    Producer interface for Measurement values.
    • Method Summary

      Modifier and Type Method Description
      static java.lang.String format​(java.text.NumberFormat nf, MeasurementValue value)
      Convenience method as replacement for currentSource.formatValue.
      abstract java.lang.String formatValue​(java.text.NumberFormat nf, MeasurementValue value)
      Returns the formatted value.
      abstract MeasurementValue getMeasurement()
      Returns a instance that reflects the current value.
      static MeasurementValue measure()
      Convenience method as replacement for currentSource.getMeasurement.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractMeasurementSource

        public AbstractMeasurementSource()
    • 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.