package org.codehaus.xfire.jaxb; import java.util.Hashtable; import net.webservicex.LocationType; import net.webservicex.WeatherDataType; public class WeatherCache { public static void addLocation(String zipCode, LocationType location) { locations.put(zipCode, location); } public static void addWeatherData(String zipCode, WeatherDataType weather) { Hashtable ht = weatherData.get(zipCode); if (ht == null) { ht = new Hashtable(); weatherData.put(zipCode, ht); } ht.put(weather.getDay(), weather); } public static LocationType getLocation(String zipCode) { return locations.get(zipCode); } public static WeatherDataType getWeather(String zipCode, String day) { Hashtable ht = getWeathers(zipCode); if (ht != null) { return ht.get(day); } return null; } public static Hashtable getWeathers(String zipCode) { return weatherData.get(zipCode); } private static Hashtable locations = new Hashtable(); private static Hashtable> weatherData = new Hashtable>(); }