added 'list' nameState to nearby station scan

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@365 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-11-23 20:11:53 +00:00
parent cc9d02175f
commit cbed3501da

View file

@ -286,6 +286,27 @@ public abstract class AbstractEfaProvider implements NetworkProvider
else
return new NearbyStationsResult(stations.subList(0, maxStations));
}
else if ("list".equals(nameState))
{
XmlPullUtil.enter(pp, "itdOdvName");
final List<Station> stations = new ArrayList<Station>();
if (XmlPullUtil.test(pp, "itdMessage"))
XmlPullUtil.next(pp);
while (XmlPullUtil.test(pp, "odvNameElem"))
{
final int stopId = Integer.parseInt(pp.getAttributeValue(null, "stopID"));
XmlPullUtil.enter(pp, "odvNameElem");
final String location = normalizeLocationName(pp.getText());
XmlPullUtil.exit(pp, "odvNameElem");
final Station newStation = new Station(stopId, location, 0, 0, 0, null, null);
if (!stations.contains(newStation))
stations.add(newStation);
}
return new NearbyStationsResult(stations);
}
else if ("notidentified".equals(nameState))
{
return new NearbyStationsResult(NearbyStationsResult.Status.INVALID_STATION);