Package ucar.units

Class UnknownUnit

  • All Implemented Interfaces:
    Serializable, Base, DerivableUnit, DerivedUnit, Unit

    @Immutable
    public final class UnknownUnit
    extends BaseUnit
    Provides support for unknown base units. This can be used, for example, to accomodate an unknown unit (e.g. "foo"). Values in such a unit will only be convertible with units derived from "foo" (e.g. "20 foo").
    See Also:
    Serialized Form
    • Method Detail

      • create

        public static UnknownUnit create​(String name)
                                  throws NameException
        Factory method for constructing an unknown unit from a name.
        Parameters:
        name - The name of the unit.
        Returns:
        The unknown unit.
        Throws:
        NameException - name == null.
      • equals

        public boolean equals​(Object object)
        Indicates if this unit is semantically identical to an object.
        Specified by:
        equals in interface Base
        Specified by:
        equals in interface Unit
        Overrides:
        equals in class DerivedUnitImpl
        Parameters:
        object - The object.
        Returns:
        true if and only if this instance is semantically identical to the object.
      • hashCode

        public int hashCode()
        Returns the hash code of this instance.
        Overrides:
        hashCode in class DerivedUnitImpl
        Returns:
        The hash code of this instance.