Package org.rometools.feed.module.yahooweather.types

Examples of org.rometools.feed.module.yahooweather.types.Forecast


        if(weather.getForecasts() != null) {
            for(int i = 0; i < weather.getForecasts().length; i++) {
                Element forecast = new Element("forecast",
                        WeatherModuleGenerator.NS);
                Forecast f = weather.getForecasts()[i];

                if(f.getCode() != null) {
                    forecast.setAttribute("code",
                        Integer.toString(f.getCode().getCode()));
                }

                if(f.getDate() != null) {
                    forecast.setAttribute("date", SHORT_DATE.format(f.getDate()));
                }

                if(f.getDay() != null) {
                    forecast.setAttribute("day", f.getDay());
                }

                if(f.getText() != null) {
                    forecast.setAttribute("text", f.getText());
                }

                forecast.setAttribute("high", Integer.toString(f.getHigh()));
                forecast.setAttribute("low", Integer.toString(f.getLow()));
                element.addContent(forecast);
            }
        }
    }
View Full Code Here


            for(Iterator it = forecasts.iterator(); it.hasNext(); i++) {
                Element forecast = (Element) it.next();

                try {
                    f[i] = new Forecast(forecast.getAttributeValue("day"),
                            SHORT_DATE.parse(forecast.getAttributeValue("date")),
                            Integer.parseInt(forecast.getAttributeValue("low")),
                            Integer.parseInt(forecast.getAttributeValue("high")),
                            forecast.getAttributeValue("text"),
                            ConditionCode.fromCode(Integer.parseInt(
View Full Code Here

TOP

Related Classes of org.rometools.feed.module.yahooweather.types.Forecast

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.