Class MeasuredQuantities

java.lang.Object
org.episteme.core.measure.metrology.MeasuredQuantities

public final class MeasuredQuantities extends Object
Factory for creating MeasuredQuantity instances.

Provides convenient methods for creating measured quantities with uncertainty.

* @author Silvere Martin-Michiellot
Since:
1.0
Author:
Gemini AI (Google DeepMind)
  • Method Details

    • create

      public static <Q extends Quantity<Q>> MeasuredQuantity<Q> create(Quantity<Q> value, Quantity<Q> uncertainty, double confidenceLevel)
      Creates a measured quantity with absolute uncertainty.
      Type Parameters:
      Q - the quantity type
      Parameters:
      value - the central value
      uncertainty - the absolute uncertainty (±)
      confidenceLevel - the confidence level (e.g., 0.95 for 95%)
      Returns:
      the measured quantity
    • create

      public static <Q extends Quantity<Q>> MeasuredQuantity<Q> create(Quantity<Q> value, Quantity<Q> uncertainty)
      Creates a measured quantity with 95% confidence (k=2).
      Type Parameters:
      Q - the quantity type
      Parameters:
      value - the central value
      uncertainty - the absolute uncertainty (±)
      Returns:
      the measured quantity with 95% confidence
    • createRelative

      public static <Q extends Quantity<Q>> MeasuredQuantity<Q> createRelative(Quantity<Q> value, double relativeUncertainty, double confidenceLevel)
      Creates a measured quantity with relative uncertainty.
      Type Parameters:
      Q - the quantity type
      Parameters:
      value - the central value
      relativeUncertainty - the relative uncertainty (e.g., 0.02 for 2%)
      confidenceLevel - the confidence level
      Returns:
      the measured quantity
    • createRelative

      public static <Q extends Quantity<Q>> MeasuredQuantity<Q> createRelative(Quantity<Q> value, double relativeUncertainty)
      Creates a measured quantity with relative uncertainty at 95% confidence.
      Type Parameters:
      Q - the quantity type
      Parameters:
      value - the central value
      relativeUncertainty - the relative uncertainty (e.g., 0.02 for 2%)
      Returns:
      the measured quantity
    • exact

      public static <Q extends Quantity<Q>> MeasuredQuantity<Q> exact(Quantity<Q> value)
      Creates an exact measurement (zero uncertainty).

      Use this for defined constants or when uncertainty is negligible.

      Type Parameters:
      Q - the quantity type
      Parameters:
      value - the exact value
      Returns:
      a measured quantity with zero uncertainty