FileDocCategorySizeDatePackage
WeeklyWeather.javaAPI DocExample1028Fri May 14 00:32:28 BST 2004com.oreilly.strutsckbk.ch04

WeeklyWeather

public class WeeklyWeather extends Object

Fields Summary
private List
weekForecast
Constructors Summary
public WeeklyWeather()

		weekForecast = new ArrayList();
		weekForecast.add(new DailyForecast("Sunday", 70, 1.5f));
		weekForecast.add(new DailyForecast("Monday", 40, 2.0f));
		weekForecast.add(new DailyForecast("Tuesday", 20, 1.0f));
		weekForecast.add(new DailyForecast("Wednesday", 5, 0.2f));
		weekForecast.add(new DailyForecast("Thursday", 50, 0.8f));
		weekForecast.add(new DailyForecast("Friday", 40, 1.0f));
		weekForecast.add(new DailyForecast("Saturday", 90, 3.0f));
	
Methods Summary
public floatgetMaxRainfall()

		float maxRainfall = 0.0f;
		for (int i=0; i<weekForecast.size(); i++) {
			DailyForecast forecast = (DailyForecast) weekForecast.get(i);
			maxRainfall = forecast.getRainfall() > maxRainfall ? forecast.getRainfall() : maxRainfall;
		}
		return maxRainfall;
	
public java.util.ListgetWeekForecast()

		return weekForecast;