Class SIUnit

All Implemented Interfaces:
Serializable, Cloneable

public class SIUnit extends Unit<SIUnit>
SIUnit describes a unit with arbitrary SI dimensions for which no predefined unit exists.

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

Author:
Alexander Verbraeck
See Also:
  • Field Details

    • DIMLESS

      public static SIUnit DIMLESS
      the SI Unit for dimensionless.
  • Constructor Details

    • SIUnit

      public SIUnit()
  • Method Details

    • of

      public static SIUnit of(String siString) throws UnitException
      Instantiate an SI unit 'of' a String.
      Parameters:
      siString - String; the SI string, e.g., "kgm/s2"
      Returns:
      the SIUnit based on the SI dimensionality
      Throws:
      UnitException - when the SI string is not according to the rules
    • of

      public static SIUnit of(SIDimensions siDimensions)
      Instantiate an SI unit 'of' a SIDimensions.
      Parameters:
      siDimensions - SIDimensions; the SI dimensions
      Returns:
      the SIUnit based on the SI dimensionality
    • toString

      public String toString()
      Overrides:
      toString in class Unit<SIUnit>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Unit<SIUnit>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Unit<SIUnit>