--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java 2010/09/16 13:32:10 1060 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java 2010/11/08 12:39:27 1188 @@ -11,11 +11,13 @@ import org.jsoup.nodes.Element; import org.jsoup.select.Elements; +import dk.thoerup.android.traininfo.common.DepartureBean; +import dk.thoerup.android.traininfo.common.DepartureEntry; +import dk.thoerup.android.traininfo.common.StationBean.StationEntry; import dk.thoerup.circuitbreaker.CircuitBreaker; import dk.thoerup.circuitbreaker.CircuitBreakerManager; import dk.thoerup.traininfoservice.StationDAO; import dk.thoerup.traininfoservice.Statistics; -import dk.thoerup.traininfoservice.StationBean.StationEntry; public class DepartureFetcher { @@ -69,21 +71,21 @@ if (station.getRegional() != null) { DepartureBean tempBean = lookupDepartures(station.getRegional(), TrainType.REGIONAL, arrival); - departureBean.departureEntries.addAll( tempBean.departureEntries ); + departureBean.entries.addAll( tempBean.entries ); departureBean.notifications.addAll(tempBean.notifications); } if (station.getStrain() != null) { DepartureBean tempBean = lookupDepartures(station.getStrain(), TrainType.STOG, arrival); - departureBean.departureEntries.addAll( tempBean.departureEntries ); + departureBean.entries.addAll( tempBean.entries ); departureBean.notifications.addAll(tempBean.notifications); } - if (departureBean.departureEntries.size() == 0) { + if (departureBean.entries.size() == 0) { logger.info("No departures found for station " + stationID); } - Collections.sort( departureBean.departureEntries ); + Collections.sort( departureBean.entries ); return departureBean; @@ -143,19 +145,19 @@ if (table != null) { Elements tableRows = table.getElementsByTag("tr"); - boolean tidsstregExists = (table.getElementsByAttributeValue("class", "Tidsstreg").size() > 0); - boolean passedTidsstreg = false; + //boolean tidsstregExists = (table.getElementsByAttributeValue("class", "Tidsstreg").size() > 0); + //boolean passedTidsstreg = false; for (Element currentRow : tableRows) { String rowClass = currentRow.attr("class"); - + /* if (tidsstregExists == true && passedTidsstreg == false) { if (currentRow.getElementsByAttributeValue("class", "Tidsstreg").size() > 0) { passedTidsstreg = true; } else { continue; } - } + }*/ if (rowClass != null && rowClass.toLowerCase().contains("station") ) { @@ -193,7 +195,7 @@ departure.setType(typeString); - departureBean.departureEntries.add( departure ); + departureBean.entries.add( departure ); } } } else { @@ -251,19 +253,19 @@ if (table != null) { Elements tableRows = table.getElementsByTag("tr"); - boolean passedTidsstreg = false; - boolean tidsstregExists = (table.getElementsByAttributeValue("class", "Tidsstreg").size() > 0); + //boolean passedTidsstreg = false; + //boolean tidsstregExists = (table.getElementsByAttributeValue("class", "Tidsstreg").size() > 0); for (Element currentRow : tableRows) { String rowClass = currentRow.attr("class"); - + /* if (tidsstregExists == true && passedTidsstreg == false) { if (currentRow.getElementsByAttributeValue("class", "Tidsstreg").size() > 0) { passedTidsstreg = true; } else { continue; } - } + }*/ if (rowClass != null && rowClass.toLowerCase().contains("station") ) { @@ -303,7 +305,7 @@ departure.setType(type); - departureBean.departureEntries.add(departure); + departureBean.entries.add(departure); }