mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-11 00:08:49 +00:00
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:
parent
cc9d02175f
commit
cbed3501da
1 changed files with 21 additions and 0 deletions
|
@ -286,6 +286,27 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
||||||
else
|
else
|
||||||
return new NearbyStationsResult(stations.subList(0, maxStations));
|
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))
|
else if ("notidentified".equals(nameState))
|
||||||
{
|
{
|
||||||
return new NearbyStationsResult(NearbyStationsResult.Status.INVALID_STATION);
|
return new NearbyStationsResult(NearbyStationsResult.Status.INVALID_STATION);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue