Class Units

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class Units
    extends Object
    implements Serializable, Cloneable
    Units for various aspects of the forecast. Attributes:
    • temperature: degree units, f for Fahrenheit or c for Celsius (character)
    • distance: units for distance, mi for miles or km for kilometers (string)
    • pressure: units of barometric pressure, in for pounds per square inch or mb for millibars (string) [I am pretty sure this is wrong. I believe this number of be inches of Mercury, not PSI.]
    • speed: units of speed, mph for miles per hour or kph for kilometers per hour (string)
    Note that the default RSS feed uses Fahrenheit degree units and English units for all other attributes (miles, pounds per square inch, miles per hour). If Celsius has been specified as the degree units for the feed (using the u request parameter), all the units are in metric format (Celsius, kilometers, millibars, kilometers per hour).
    See Also:
    Serialized Form
    • Constructor Detail

      • Units

        public Units()
        Simple constructor.
      • Units

        public Units​(String temperature,
                     String distance,
                     String pressure,
                     String speed)
        Parameters:
        temperature - units of temp ("f" or "c");
        distance - units of distance ("mi" or "km")
        pressure - units of pressure ("in" or "mb")
        speed - units of speed ("mph" or "kph")
    • Method Detail

      • getTemperature

        public String getTemperature()
        Units of Temperature.
        Returns:
        temperature units of temp ("f" or "c");
      • setTemperature

        public void setTemperature​(String temperature)
        Units of Temperature.
        Parameters:
        temperature - units of temp ("f" or "c");
      • getDistance

        public String getDistance()
        Units of distance
        Returns:
        distance units of distance ("mi" or "km")
      • setDistance

        public void setDistance​(String distance)
        Units of distance
        Parameters:
        distance - units of distance ("mi" or "km")
      • getPressure

        public String getPressure()
        Units of pressure
        Returns:
        units of pressure ("in" or "mb")
      • setPressure

        public void setPressure​(String pressure)
        Units of pressure
        Parameters:
        pressure - units of pressure ("in" or "mb")
      • getSpeed

        public String getSpeed()
        Units of speed
        Returns:
        units of speed ("mph" or "kph")
      • setSpeed

        public void setSpeed​(String speed)
        Units of speed
        Parameters:
        speed - units of speed ("mph" or "kph")
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object