parse additional message for Frankfurt

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@154 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-09-08 17:06:44 +00:00
parent 6f16898846
commit 7dfc244ce7
4 changed files with 48 additions and 28 deletions

View file

@ -454,7 +454,7 @@ public final class VbbProvider implements NetworkProvider
{
final int arrivalId = mDetFine.group(12) != null ? Integer.parseInt(mDetFine.group(12)) : 0;
final String arrival = ParserUtils.resolveEntities(selectNotNull(mDetFine.group(13), mDetFine.group(16), mDetFine.group(17)));
final String arrival = ParserUtils.resolveEntities(ParserUtils.selectNotNull(mDetFine.group(13), mDetFine.group(16), mDetFine.group(17)));
final double arrivalLon = mDetFine.group(14) != null ? latLonToDouble(Integer.parseInt(mDetFine.group(14))) : 0;
@ -494,22 +494,6 @@ public final class VbbProvider implements NetworkProvider
}
}
private static String selectNotNull(final String... groups)
{
String selected = null;
for (final String group : groups)
{
if (group != null)
{
if (selected == null)
selected = group;
else
throw new IllegalStateException("ambiguous");
}
}
return selected;
}
private static final String DEPARTURE_URL_LIVE = "http://mobil.bvg.de/IstAbfahrtzeiten/index/mobil?";
private static final String DEPARTURE_URL_PLAN = "http://mobil.bvg.de/Fahrinfo/bin/stboard.bin/dox/dox?boardType=dep&start=yes&";