Interface Scale

All Superinterfaces:
Serializable
All Known Implementing Classes:
GradeScale, IdentityScale, LinearScale

public interface Scale extends Serializable
Scales for unit conversion, offers functions to and from SI units. E.g., LinearScale for Length, Area, etc. GradeScale for percentual angle.

Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.

Author:
Alexander Verbraeck, Peter Knoppers
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    fromIdentityScale(double value)
    Convert a value from a base (SI) value on the identity scale to a value in the unit that uses this scale.
    boolean
    Return whether a scale is an 'identity' scale.
    double
    toIdentityScale(double value)
    Convert a value expressed in this unit to its base (SI) value on the identity scale.
  • Method Details

    • toIdentityScale

      double toIdentityScale(double value)
      Convert a value expressed in this unit to its base (SI) value on the identity scale.
      Parameters:
      value - the value expressed in this unit
      Returns:
      the value converted to its SI value
    • fromIdentityScale

      double fromIdentityScale(double value)
      Convert a value from a base (SI) value on the identity scale to a value in the unit that uses this scale.
      Parameters:
      value - the value to convert
      Returns:
      the corresponding value in the given unit
    • isIdentityScale

      boolean isIdentityScale()
      Return whether a scale is an 'identity' scale. For a linear scale, any scale with conversion factor 1 would be considered an identity scale.
      Returns:
      whether the scale is an 'identity' scale