Class AlternateUnit<Q extends Quantity<Q>>

  • All Implemented Interfaces:
    Serializable, Comparable<Unit<Q>>, Unit<Q>, tech.uom.lib.common.function.Nameable, tech.uom.lib.common.function.PrefixOperator<Q>, tech.uom.lib.common.function.SymbolSupplier

    public final class AlternateUnit<Q extends Quantity<Q>>
    extends AbstractUnit<Q>

    This class represents units used in expressions to distinguish between quantities of a different nature but of the same dimensions.

    Examples of alternate units:

    Unit<Angle> RADIAN = AlternateUnit.of(ONE, "rad").asType(Angle.class);
    Unit<Force> NEWTON = AlternateUnit.of(METRE.multiply(KILOGRAM).divide(SECOND.pow(2)), "N").asType(Force.class);
    Unit<Pressure> PASCAL = AlternateUnit.of(NEWTON.divide(METRE.pow(2), "Pa").asType(Pressure.class);
    Since:
    1.0
    Version:
    2.1, October 3, 2024
    Author:
    Jean-Marie Dautelle, Werner Keil
    See Also:
    Serialized Form