Class UnitConcept

    • Field Detail

      • _unitFactor

        protected ScalarToken _unitFactor
        The multiplication factor for converting this unit to the SI unit for this physical dimension.
      • _unitOffset

        protected ScalarToken _unitOffset
        The offset factor for converting this unit to the SI unit for this physical dimension.
    • Method Detail

      • canBeConvertedTo

        public boolean canBeConvertedTo​(UnitConcept unit)
        Return true if this unit can be converted to the specified unit.
        Parameters:
        unit - The other unit concept to compare to this one.
        Returns:
        true if the units can be converted, false otherwise.
      • getDimension

        public DimensionRepresentativeConcept getDimension()
        Return the the dimension concept for this unit concept.
        Returns:
        The dimension concept to which this unit concept belongs.
      • getUnitFactor

        public ScalarToken getUnitFactor()
        Return the multiplication factor that converts a value in this unit to the SI unit for this dimension.
        Returns:
        The unit factor as a scalar token.
      • getUnitName

        public java.lang.String getUnitName()
        Return the name of the unit.
        Returns:
        The name of the unit.
      • getUnitOffset

        public ScalarToken getUnitOffset()
        Return the offset factor that converts a value in this unit to the SI unit for this dimension. Currently this is only used for temperature unit conversions.
        Returns:
        The unit offset as a scalar token.
      • toString

        public java.lang.String toString()
        Return the string representation of this base unit concept. It concatenates the name of the representative concept physical dimension name with the name of the unit.
        Overrides:
        toString in class FlatTokenInfiniteConcept
        Returns:
        The string representation of this concept.