Java Reference
In-Depth Information
hasForecast = false;
}
if ( qName.equals(Location.XML_TAG_TEMPS)) {
String u = parser.getAttributeValue(null,Location.XML_ATTR_UNITS);
if ( u != null && u.equals("F") != 0)
throw new Exception("Invalid temperature units");
hasForecast = false;
}
if ( qName.equals(Location.XML_TAG_TEMP)) {
String t = parser.getAttributeValue(null,Location.XML_ATTR_TYPE);
if (t != null && t.equals("current") == 0) {
setTemp = true;
} else {
setTemp = false;
}
hasForecast = false;
}
if ( qName.equals(Location.XML_TAG_WIND)) {
String u = parser.getAttributeValue(null,Location.XML_ATTR_UNITS);
if ( u != null && u.equals("MPH") != 0)
throw new Exception("Invalid temperature units");
hasForecast = false;
}
if ( qName.equals(Location.XML_TAG_PRECIP))
{
String u = parser.getAttributeValue(null,Location.XML_ATTR_UNITS);
if (u != null && u.equals("in") != 0)
throw new Exception("Invalid precipitation units");
precipProb = parser.getAttributeValue(null,Location.XML_ATTR_PROB);
precipType = parser.getAttributeValue(null,Location.XML_ATTR_TYPE);
hasForecast = false;
}
if (qName.equals(Location.XML_TAG_TEXT)) {
hasForecast = true;
}
if (qName.equals(Location.XML_TAG_WHEN) && hasForecast) {
String w = parser.getAttributeValue(null,Location.XML_ATTR_TIME);
if (w != null && w.equals("now") == 0) {
setForecast = true;
} else {
setForecast = false;
}
}
}
 
Search WWH ::




Custom Search