Documentation API of the 'javax.measure.Measurable' Java class

Interface Measurable<Q extends Quantity>

  • All Superinterfaces:
    All Known Implementing Classes:
    Altitude, Amount, DecimalMeasure, Height, Measure, Time, VectorMeasure

    public interface Measurable<Q extends Quantity>extends Comparable<Measurable<Q>>

    This interface represents the measurable, countable, or comparable property or aspect of a thing.

    Implementing instances are typically the result of a measurement:

             Measurable<Mass> weight = Measure.valueOf(180.0, POUND);     
    They can also be created from custom classes:
         class Delay implements Measurable<Duration> {          private long nanoSeconds; // Implicit internal unit.          public double doubleValue(Unit<Velocity> unit) { ... }          public long longValue(Unit<Velocity> unit) { ... }     }     Thread.wait(new Delay(24, HOUR)); // Assuming Thread.wait(Measurable<Duration>) method.     

    Although measurable instances are for the most part scalar quantities; more complex implementations (e.g. vectors, data set) are allowed as long as an aggregate magnitude can be determined. For example:

         class Velocity3D implements Measurable<Velocity> {          private double x, y, z; // Meter per seconds.          public double doubleValue(Unit<Velocity> unit) { ... } // Returns vector norm.          ...      }     class Sensors<Q extends Quantity> extends Measure<double[], Q> {          public doubleValue(Unit<Q> unit) { ... } // Returns median value.           ...     } 

Warning: You cannot see the full API documentation of this class since the access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To view the complete description of this class and its methods, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.