Class SimpleUnit

    • Field Detail

      • unitType

        protected UnitType unitType
        type of the unit
    • Constructor Detail

      • SimpleUnit

        protected SimpleUnit​(UnitType unitType)
        Constructor
        Parameters:
        unitType - to use
    • Method Detail

      • isCombinedUnit

        public boolean isCombinedUnit()
        Is the unit a single or combined unit
        Specified by:
        isCombinedUnit in interface Unit
        Returns:
        false when single, true when combined
      • canConvertTo

        public boolean canConvertTo​(Unit other)
        Verify if unit can be converted to the desired unit
        Specified by:
        canConvertTo in interface Unit
        Parameters:
        other - to unit
        Returns:
        true when compatible, false otherwise