Enum Class Mass

java.lang.Object
java.lang.Enum<Mass>
org.tquadrat.foundation.value.Mass
All Implemented Interfaces:
Serializable, Comparable<Mass>, Constable, Dimension, DimensionWithLinearConversion

@ClassVersion(sourceVersion="$Id: Mass.java 1195 2026-04-15 21:33:40Z tquadrat $") @API(status=STABLE, since="0.1.0") public enum Mass extends Enum<Mass> implements DimensionWithLinearConversion
The various instances of masses and weights (although this is not really the same, from a physical or scientific point of view ...).
Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: Mass.java 1195 2026-04-15 21:33:40Z tquadrat $
Since:
0.1.0
UML Diagram
UML Diagram for "org.tquadrat.foundation.value.Mass"

UML Diagram for "org.tquadrat.foundation.value.Mass"

UML Diagram for "org.tquadrat.foundation.value.Mass"
  • Enum Constant Details

    • MILLIGRAM

      public static final Mass MILLIGRAM
      A milligram.
    • GRAIN

      public static final Mass GRAIN
      An English grain. This unit is still in use to define the mass of firearm bullets, arrow heads, or the explosives load for firearm cartridges.
    • CARAT

      public static final Mass CARAT
      A metric carat; this is defined as 0.2 g; although no unit sign is officially defined, the use of "ct" is widely accepted. That is why we use it here as well.
    • GRAM

      public static final Mass GRAM
      A gram.
    • DRAM

      public static final Mass DRAM
      A dram (Avoirdupois), a 1/16 of an ounce.
    • OUNCE

      public static final Mass OUNCE
      An ounce (Avoirdupois), a 1/16 of a pound.
    • TROY_OUNCE

      public static final Mass TROY_OUNCE
      A troy ounce (same as Apothecaries Ounce, as used for precious metals).
    • POUND

      public static final Mass POUND
      An imperial pound (Avoirdupois), 7000 grain.
    • KILOGRAM

      public static final Mass KILOGRAM
      A kilogram.
    • STONE

      public static final Mass STONE

      A stone; although abandoned since 1985, it will still be used in some Commonwealth countries to determine the body weight.

      1 st = 14 lb. = 224 oz. = 3584 dr.

    • SHORT_TON

      public static final Mass SHORT_TON
      A short ton (2000 pound avoirdupois).
    • TON

      public static final Mass TON
      A metric ton.
    • SOLAR_MASS

      @API(status=STABLE, since="0.3.0") public static final Mass SOLAR_MASS

      The (estimated) mass of our sun. This is often used when comparing stars.

    • EARTH_MASS

      @API(status=STABLE, since="0.3.0") public static final Mass EARTH_MASS

      The mass of our planet Earth. This is often used when comparing masses of astronomical objects.

  • Field Details

  • Constructor Details

    • Mass

      private Mass(BigDecimal factor, String unitSymbol)
      Creates a new Mass instance with a default precision of zero mantissa digits.
      Parameters:
      factor - The factor.
      unitSymbol - The unit string.
    • Mass

      private Mass(BigDecimal factor, String unitSymbol, int precision)
      Creates a new Mass instance.
      Parameters:
      factor - The factor.
      unitSymbol - The unit string.
      precision - The default precision.
  • Method Details