1 /* 2 * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences. 3 * Copyright (C) 2006 - JScience (http://jscience.org/) 4 * All rights reserved. 5 * 6 * Permission to use, copy, modify, and distribute this software is 7 * freely granted, provided that this notice is preserved. 8 */ 9 package javax.measure.quantities; 10 11 import javax.measure.units.Unit; 12 13 /** 14 * This interface represents the measurable, countable, or comparable property 15 * or aspect of a thing. 16 * 17 * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a> 18 * @version 1.0, January 14, 2006 19 */ 20 public interface Quantity<Q extends Quantity> { 21 22 /** 23 * Returns the estimated value of this quantity stated in the specified 24 * unit as a <code>double</code>. 25 * 26 * @param unit the unit in which the measurement value is stated. 27 * @return the numeric value after conversion to type <code>double</code>. 28 */ 29 double doubleValue(Unit<Q> unit); 30 31 /** 32 * Returns the estimated value of this quantity stated in the specified 33 * unit as a <code>long</code>. 34 * 35 * @param unit the unit in which the measurement value is stated. 36 * @return the numeric value after conversion to type <code>long</code>. 37 * @throws ArithmeticException if this quantity cannot be represented 38 * as a <code>long</code> number in the specified unit. 39 */ 40 long longValue(Unit<Q> unit) throws ArithmeticException; 41 42 } 43