Class Unit

    • Field Detail

    • Constructor Detail

      • Unit

        public Unit()
    • Method Detail

      • isNormal

        public final boolean isNormal()
        Returns true iff this unit is normal. I.e. this unit is a BaseUnit or a CompoundUnit which consists only of BaseUnits.
        Returns:
        true iff this unit is normal.
      • getNormalizedUnit

        public abstract Unit getNormalizedUnit()
        Calculate the base unit or a compound unit that consists of base units only, without any prefixes. This is the target unit of the converter.
        Returns:
        base unit/compound of base units.
      • getConverter

        public abstract Converter getConverter()
        Return a converter for a conversion of this unit to the normalized unit.
        Returns:
      • transform

        protected Unit transform​(Converter c)
        Transform this unit into another by means of a converter. That is basically a way of defining a new unit. E.g. Unit degree_celcius = kelvin.transform(new AddConverter(-273.15)); The converter defines the function which converts a value of the new unit into this unit.
        Parameters:
        c -
        Returns:
      • power

        public Unit power​(int i)
      • setPrefixableBy

        public Unit setPrefixableBy​(String prefixes)
      • getPrefixableBy

        public String getPrefixableBy()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isPrefixableBy

        public boolean isPrefixableBy​(Prefix p)