Class Unit

  • Direct Known Subclasses:
    CountUnit, MassUnit, VolumeUnit

    public abstract class Unit
    extends java.lang.Object
    Unit is an abstract class that contains the conversion factor and unit
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double conversionFactor
      The conversion factor for the unit
      protected java.util.Set<java.lang.String> systems
      The unit systems that the unit is in
    • Constructor Summary

      Constructors 
      Constructor Description
      Unit​(java.lang.String unit)
      The constructor for the Unit class that initializes the unit
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getConversionFactor()
      The getter for the conversion factor
      java.util.Set<java.lang.String> getSystems()
      The getter for the unit systems
      java.lang.String getUnit()
      The getter for the unit string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • conversionFactor

        protected double conversionFactor
        The conversion factor for the unit
      • systems

        protected java.util.Set<java.lang.String> systems
        The unit systems that the unit is in
    • Constructor Detail

      • Unit

        public Unit​(java.lang.String unit)
        The constructor for the Unit class that initializes the unit
        Parameters:
        unit - the unit string
    • Method Detail

      • getUnit

        public java.lang.String getUnit()
        The getter for the unit string
        Returns:
        the unit string
      • getConversionFactor

        public double getConversionFactor()
        The getter for the conversion factor
        Returns:
        the conversion factor
      • getSystems

        public java.util.Set<java.lang.String> getSystems()
        The getter for the unit systems
        Returns:
        the unit systems