View Javadoc
1   package org.djunits.unit.scale;
2   
3   /**
4    * Scales for unit conversion, offers functions to and from SI units. E.g., LinearScale for Length, Area, etc. LinearOffsetScale
5    * for Temperature. PercentScale for Angle. LogarithmicScale for Sound.
6    * <p>
7    * Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
8    * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
9    * </p>
10   * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
11   * initial version Oct 11, 2015 <br>
12   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
13   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
14   */
15  public interface Scale
16  {
17      /**
18       * Convert a value to an SI value using this scale.
19       * @param value the value to convert
20       * @return the corresponding SI value
21       */
22      double toStandardUnit(double value);
23  
24      /**
25       * Convert a value from an SI value to a value in the unit that uses this scale.
26       * @param value the value to convert
27       * @return the corresponding value in the given unit
28       */
29      double fromStandardUnit(double value);
30  
31      /**
32       * Return whether this is a base (SI) scale.
33       * @return boolean; whether this is a base (SI) scale or not
34       */
35      boolean isBaseSIScale();
36  }