Class Measure<V extends Number,​Q extends Quantity<Q>>

  • Type Parameters:
    V -
    Q -
    All Implemented Interfaces:
    Comparable<Measure<V,​Q>>

    public abstract class Measure<V extends Number,​Q extends Quantity<Q>>
    extends Object
    implements Comparable<Measure<V,​Q>>
    Measurement recorded in provided unit.
    Author:
    Jody Garnett
    • Constructor Summary

      Constructors 
      Constructor Description
      Measure()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(Measure<V,​Q> obj)  
      double doubleValue​(Unit<Q> unit)
      Double representation of getValue() in the requested unit (values outside of the range Double.MIN_VALUE - Double.MAX_VALUE are represented as infinite).
      long longValue​(Unit<Q> unit)
      Long representation of getValue() in the requested unit (clipped to range Long.MIN_VALUE - Double.MAX_VALUE).
      Number numericValue​(Unit<Q> unit)
      Numeric representation of measure in the provided unit
      • Methods inherited from class Object

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

      • Measure

        public Measure()
    • Method Detail

      • numericValue

        public Number numericValue​(Unit<Q> unit)
        Numeric representation of measure in the provided unit
        Returns:
        numeric representation.
      • doubleValue

        public double doubleValue​(Unit<Q> unit)
        Double representation of getValue() in the requested unit (values outside of the range Double.MIN_VALUE - Double.MAX_VALUE are represented as infinite).
        Parameters:
        unit - to convert to double
      • longValue

        public long longValue​(Unit<Q> unit)
        Long representation of getValue() in the requested unit (clipped to range Long.MIN_VALUE - Double.MAX_VALUE).
        Parameters:
        unit - to convert to double
      • compareTo

        public int compareTo​(Measure<V,​Q> obj)
        Specified by:
        compareTo in interface Comparable<V extends Number>