Class Forecast

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class Forecast
    extends Object
    implements Serializable, Cloneable
    The weather forecast for a specific day. The item element contains multiple forecast elements for today and tomorrow. Attributes:
    • day: day of the week to which this forecast applies. Possible values are Mon Tue Wed Thu Fri Sat Sun (string)
    • date: the date to which this forecast applies. The date is in "dd Mmm yyyy" format, for example "30 Nov 2005" (string)
    • low: the forecasted low temperature for this day, in the units specified by the yweather:units element (integer)
    • high: the forecasted high temperature for this day, in the units specified by the yweather:units element (integer)
    • text: a textual description of conditions, for example, "Partly Cloudy" (string)
    • code: the condition code for this forecast. You could use this code to choose a text description or image for the forecast. The possible values for this element are described in Condition Codes (integer)
    See Also:
    ConditionCode, Serialized Form
    • Constructor Detail

      • Forecast

        public Forecast()
        Simple constructor.
      • Forecast

        public Forecast​(String day,
                        Date date,
                        int low,
                        int high,
                        String text,
                        ConditionCode code)
        Parameters:
        day - day of the week to which this forecast applies. Possible values are Mon Tue Wed Thu Fri Sat Sun (string)
        date - the date to which this forecast applies
        low - the forecasted low temperature for this day
        high - the forecasted high temperature for this day
        text - a textual description of conditions, for example, "Partly Cloudy"
        code - ConditionCode instance for this forcast.
    • Method Detail

      • getDay

        public String getDay()
        Day of week
        Returns:
        day of the week to which this forecast applies. Possible values are Mon Tue Wed Thu Fri Sat Sun (string)
      • setDay

        public void setDay​(String day)
        Day of week
        Parameters:
        day - day of the week to which this forecast applies. Possible values are Mon Tue Wed Thu Fri Sat Sun (string)
      • getDate

        public Date getDate()
        For date.
        Returns:
        the date to which this forecast applies
      • setDate

        public void setDate​(Date date)
        For date.
        Parameters:
        date - the date to which this forecast applies
      • getLow

        public int getLow()
        Low temperature.
        Returns:
        the forecasted low temperature for this day
        See Also:
        Units
      • setLow

        public void setLow​(int low)
        Low temperature
        Parameters:
        low - the forecasted low temperature for this day
        See Also:
        Units
      • getHigh

        public int getHigh()
        High temperature
        Returns:
        the forecasted high temperature for this day
        See Also:
        Units
      • setHigh

        public void setHigh​(int high)
        High temperature
        Parameters:
        high - the forecasted high temperature for this day
        See Also:
        Units
      • getText

        public String getText()
        Text summary
        Returns:
        a textual description of conditions, for example, "Partly Cloudy"
      • setText

        public void setText​(String text)
        Text summary
        Parameters:
        text - a textual description of conditions, for example, "Partly Cloudy"
      • getCode

        public ConditionCode getCode()
        Condition code
        Returns:
        the condition code for this forecast
      • setCode

        public void setCode​(ConditionCode code)
        Condition code
        Parameters:
        code - the condition code for this forecast
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object