JSR-275 - Measurements and Units Specification

javax.measure
Interface Measurable<Q extends Quantity>

All Superinterfaces:
java.lang.Comparable<Measurable<Q>>
All Known Implementing Classes:
Measure

public interface Measurable<Q extends Quantity>
extends java.lang.Comparable<Measurable<Q>>

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

Version:
4.0, February 25, 2007
Author:
Jean-Marie Dautelle

Method Summary
 double doubleValue(Unit<Q> unit)
          Returns the estimated value of this measurable quantity stated in the specified unit as a double.
 long longValue(Unit<Q> unit)
          Returns the estimated value of this quantity stated in the specified unit as a long.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

doubleValue

double doubleValue(Unit<Q> unit)
Returns the estimated value of this measurable quantity stated in the specified unit as a double.

Parameters:
unit - the unit in which the measurement value is stated.
Returns:
the numeric value after conversion to type double.

longValue

long longValue(Unit<Q> unit)
               throws java.lang.ArithmeticException
Returns the estimated value of this quantity stated in the specified unit as a long.

Parameters:
unit - the unit in which the measurement value is stated.
Returns:
the numeric value after conversion to type long.
Throws:
java.lang.ArithmeticException - if this quantity cannot be represented as a long number in the specified unit.

JSR-275 - Measurements and Units Specification

Copyright © 2007 JSR-275