1 package name.gumartinm.weather.information.service;
3 import name.gumartinm.weather.information.R;
5 import java.util.HashMap;
8 public enum IconsList {
11 public int getResourceDrawable() {
12 return R.drawable.weather_clear;
15 // TODO: I am sometimes receiving this code, there is no documentation about it on the
16 // openweathermap site.... But it exists!!! Some day, try to find out more information about it.
17 // see: http://openweathermap.org/img/w/01dd.png
20 public int getResourceDrawable() {
21 return R.drawable.weather_clear;
26 public int getResourceDrawable() {
27 return R.drawable.weather_clear_night;
32 public int getResourceDrawable() {
33 return R.drawable.weather_few_clouds;
38 public int getResourceDrawable() {
39 return R.drawable.weather_few_clouds_night;
44 public int getResourceDrawable() {
45 return R.drawable.weather_few_clouds;
50 public int getResourceDrawable() {
51 return R.drawable.weather_few_clouds;
56 public int getResourceDrawable() {
57 return R.drawable.weather_overcast;
62 public int getResourceDrawable() {
63 return R.drawable.weather_overcast;
68 public int getResourceDrawable() {
69 return R.drawable.weather_showers;
74 public int getResourceDrawable() {
75 return R.drawable.weather_showers;
80 public int getResourceDrawable() {
81 return R.drawable.weather_showers_scattered;
86 public int getResourceDrawable() {
87 return R.drawable.weather_showers_scattered;
92 public int getResourceDrawable() {
93 return R.drawable.weather_storm;
98 public int getResourceDrawable() {
99 return R.drawable.weather_storm;
104 public int getResourceDrawable() {
105 return R.drawable.weather_snow;
110 public int getResourceDrawable() {
111 return R.drawable.weather_snow;
116 public int getResourceDrawable() {
117 return R.drawable.weather_fog;
122 public int getResourceDrawable() {
123 return R.drawable.weather_fog;
127 private final String icon;
128 // Map with every enum constant. Class variable initializer. JLS§12.4.2
129 // Executed in textual order.
130 private static final Map<String, IconsList> codeMap = new HashMap<String, IconsList>();
132 // Static initializer. JLS§12.4.2 Executed in textual order.
134 for (final IconsList code : IconsList.values()) {
135 codeMap.put(code.getIcon(), code);
139 private IconsList(final String icon) {
143 public static final IconsList getIcon(final String icon) {
144 return codeMap.get(icon);
147 private String getIcon() {
151 public abstract int getResourceDrawable();