Refactor WeatherInfo class
- Builder constructor takes now 3 args: city name, temp and temp
unit. This is the minimun data that a weather service should
provide when a weather update request is processed.
- Float members have been changed to double. Setter/getter methods
updated.
- New setter/getter methods have been added to set current day high
and low temp. Forecast list should be used only to provide weather
forecast for upcoming days (this has been clearly documented).
WeatherContract was updated to include these 2 new columns
- Added javadoc to all public methods
- Timestamp is not longer required in constructor. A new method
setTimestamp has been added
Change-Id: Ia1edcfef0e2268f3881fed076c6ad74a81ca7334
TICKET: CYNGNOS-2365
TICKET: CYNGNOS-2382
TICKET: CYNGNOS-2356
TICKET: CYNGNOS-2360
diff --git a/api/cm_current.txt b/api/cm_current.txt
index 4c39eec..4242d32 100644
--- a/api/cm_current.txt
+++ b/api/cm_current.txt
@@ -1107,7 +1107,6 @@
field public static final android.net.Uri CONTENT_URI;
field public static final android.net.Uri CURRENT_AND_FORECAST_WEATHER_URI;
field public static final java.lang.String CURRENT_CITY = "city";
- field public static final java.lang.String CURRENT_CITY_ID = "city_id";
field public static final java.lang.String CURRENT_CONDITION = "condition";
field public static final java.lang.String CURRENT_CONDITION_CODE = "condition_code";
field public static final java.lang.String CURRENT_HUMIDITY = "humidity";
@@ -1123,6 +1122,8 @@
field public static final java.lang.String FORECAST_HIGH = "forecast_high";
field public static final java.lang.String FORECAST_LOW = "forecast_low";
field public static final android.net.Uri FORECAST_WEATHER_URI;
+ field public static final java.lang.String TODAYS_HIGH_TEMPERATURE = "todays_high";
+ field public static final java.lang.String TODAYS_LOW_TEMPERATURE = "todays_low";
}
public static final class WeatherContract.WeatherColumns.TempUnit {
@@ -1342,46 +1343,47 @@
public final class WeatherInfo implements android.os.Parcelable {
method public int describeContents();
method public java.lang.String getCity();
- method public java.lang.String getCityId();
method public int getConditionCode();
method public java.util.ArrayList<cyanogenmod.weather.WeatherInfo.DayForecast> getForecasts();
- method public float getHumidity();
- method public float getTemperature();
+ method public double getHumidity();
+ method public double getTemperature();
method public int getTemperatureUnit();
method public long getTimestamp();
- method public float getWindDirection();
- method public float getWindSpeed();
+ method public double getTodaysHigh();
+ method public double getTodaysLow();
+ method public double getWindDirection();
+ method public double getWindSpeed();
method public int getWindSpeedUnit();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<cyanogenmod.weather.WeatherInfo> CREATOR;
}
public static class WeatherInfo.Builder {
- ctor public WeatherInfo.Builder(long);
+ ctor public WeatherInfo.Builder(java.lang.String, double, int);
method public cyanogenmod.weather.WeatherInfo build();
- method public cyanogenmod.weather.WeatherInfo.Builder setCity(java.lang.String, java.lang.String);
method public cyanogenmod.weather.WeatherInfo.Builder setForecast(java.util.ArrayList<cyanogenmod.weather.WeatherInfo.DayForecast>);
- method public cyanogenmod.weather.WeatherInfo.Builder setHumidity(float);
- method public cyanogenmod.weather.WeatherInfo.Builder setTemperature(float, int);
+ method public cyanogenmod.weather.WeatherInfo.Builder setHumidity(double);
+ method public cyanogenmod.weather.WeatherInfo.Builder setTimestamp(long);
+ method public cyanogenmod.weather.WeatherInfo.Builder setTodaysHigh(double);
+ method public cyanogenmod.weather.WeatherInfo.Builder setTodaysLow(double);
method public cyanogenmod.weather.WeatherInfo.Builder setWeatherCondition(int);
- method public cyanogenmod.weather.WeatherInfo.Builder setWind(float, float, int);
+ method public cyanogenmod.weather.WeatherInfo.Builder setWind(double, double, int);
}
public static class WeatherInfo.DayForecast implements android.os.Parcelable {
method public int describeContents();
method public int getConditionCode();
- method public float getHigh();
- method public float getLow();
+ method public double getHigh();
+ method public double getLow();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<cyanogenmod.weather.WeatherInfo.DayForecast> CREATOR;
}
public static class WeatherInfo.DayForecast.Builder {
- ctor public WeatherInfo.DayForecast.Builder();
+ ctor public WeatherInfo.DayForecast.Builder(int);
method public cyanogenmod.weather.WeatherInfo.DayForecast build();
- method public cyanogenmod.weather.WeatherInfo.DayForecast.Builder setHigh(float);
- method public cyanogenmod.weather.WeatherInfo.DayForecast.Builder setLow(float);
- method public cyanogenmod.weather.WeatherInfo.DayForecast.Builder setWeatherCondition(int);
+ method public cyanogenmod.weather.WeatherInfo.DayForecast.Builder setHigh(double);
+ method public cyanogenmod.weather.WeatherInfo.DayForecast.Builder setLow(double);
}
public final class WeatherLocation implements android.os.Parcelable {