Advertisement
yo2man

Current Weather first step, simple

Jul 8th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.58 KB | None | 0 0
  1. // Creating the Model, Current Weather first step, simple
  2.  
  3. package com.teamtreehouse.stormy;
  4.  
  5. public class CurrentWeather {
  6.  
  7.     private String mIcon; // The Icon // it comes from Forecast API as a string, we convert it to an int
  8.     private long mTime; //Time
  9.     private double mTemperature; //Temp
  10.     private double mHumidity; //humidity
  11.     private double mPrecipChance; //chance of precipitation
  12.     private String mSummary; //summary at the bottom
  13.  
  14.     // Step 2: Generate getters and setters for everything: Code>Generate...>Getters and Setters:
  15.     public double getHumidity() {
  16.         return mHumidity;
  17.     }
  18.  
  19.     public void setHumidity(double humidity) {
  20.         mHumidity = humidity;
  21.     }
  22.  
  23.     public String getIcon() {
  24.         return mIcon;
  25.     }
  26.  
  27.     public void setIcon(String icon) {
  28.         mIcon = icon;
  29.     }
  30.  
  31.     public double getPrecipChance() {
  32.         return mPrecipChance;
  33.     }
  34.  
  35.     public void setPrecipChance(double precipChance) {
  36.         mPrecipChance = precipChance;
  37.     }
  38.  
  39.     public String getSummary() {
  40.         return mSummary;
  41.     }
  42.  
  43.     public void setSummary(String summary) {
  44.         mSummary = summary;
  45.     }
  46.  
  47.     public double getTemperature() {
  48.         return mTemperature;
  49.     }
  50.  
  51.     public void setTemperature(double temperature) {
  52.         mTemperature = temperature;
  53.     }
  54.  
  55.     public long getTime() {
  56.         return mTime;
  57.     }
  58.  
  59.     public void setTime(long time) {
  60.         mTime = time;
  61.     }
  62.  
  63. }
  64.  
  65. simple
  66.  
  67. // https://teamtreehouse.com/library/build-a-weather-app/working-with-json/creating-the-model
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement