mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 09:00:36 +00:00
PassList is optional
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@649 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
52a57e2f25
commit
d47a5ac9d2
1 changed files with 29 additions and 23 deletions
|
@ -720,7 +720,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
Location destination = null;
|
Location destination = null;
|
||||||
int min = 0;
|
int min = 0;
|
||||||
|
|
||||||
final List<Stop> intermediateStops = new LinkedList<Stop>();
|
List<Stop> intermediateStops = null;
|
||||||
|
|
||||||
final String tag = pp.getName();
|
final String tag = pp.getName();
|
||||||
if (tag.equals("Journey"))
|
if (tag.equals("Journey"))
|
||||||
|
@ -760,33 +760,39 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
}
|
}
|
||||||
XmlPullUtil.exit(pp, "JourneyAttributeList");
|
XmlPullUtil.exit(pp, "JourneyAttributeList");
|
||||||
|
|
||||||
XmlPullUtil.enter(pp, "PassList");
|
if (XmlPullUtil.test(pp, "PassList"))
|
||||||
while (XmlPullUtil.test(pp, "BasicStop"))
|
|
||||||
{
|
{
|
||||||
XmlPullUtil.enter(pp, "BasicStop");
|
intermediateStops = new LinkedList<Stop>();
|
||||||
while (XmlPullUtil.test(pp, "StAttrList"))
|
|
||||||
XmlPullUtil.next(pp);
|
|
||||||
final Location location = parseLocation(pp);
|
|
||||||
if (location.id != sectionDeparture.id)
|
|
||||||
{
|
|
||||||
if (XmlPullUtil.test(pp, "Arr"))
|
|
||||||
XmlPullUtil.next(pp);
|
|
||||||
if (XmlPullUtil.test(pp, "Dep"))
|
|
||||||
{
|
|
||||||
XmlPullUtil.enter(pp, "Dep");
|
|
||||||
XmlPullUtil.require(pp, "Time");
|
|
||||||
time.setTimeInMillis(currentDate.getTimeInMillis());
|
|
||||||
parseTime(time, XmlPullUtil.text(pp));
|
|
||||||
final String position = parsePlatform(pp);
|
|
||||||
XmlPullUtil.exit(pp, "Dep");
|
|
||||||
|
|
||||||
intermediateStops.add(new Stop(location, position, time.getTime()));
|
XmlPullUtil.enter(pp, "PassList");
|
||||||
|
while (XmlPullUtil.test(pp, "BasicStop"))
|
||||||
|
{
|
||||||
|
XmlPullUtil.enter(pp, "BasicStop");
|
||||||
|
while (XmlPullUtil.test(pp, "StAttrList"))
|
||||||
|
XmlPullUtil.next(pp);
|
||||||
|
final Location location = parseLocation(pp);
|
||||||
|
if (location.id != sectionDeparture.id)
|
||||||
|
{
|
||||||
|
if (XmlPullUtil.test(pp, "Arr"))
|
||||||
|
XmlPullUtil.next(pp);
|
||||||
|
if (XmlPullUtil.test(pp, "Dep"))
|
||||||
|
{
|
||||||
|
XmlPullUtil.enter(pp, "Dep");
|
||||||
|
XmlPullUtil.require(pp, "Time");
|
||||||
|
time.setTimeInMillis(currentDate.getTimeInMillis());
|
||||||
|
parseTime(time, XmlPullUtil.text(pp));
|
||||||
|
final String position = parsePlatform(pp);
|
||||||
|
XmlPullUtil.exit(pp, "Dep");
|
||||||
|
|
||||||
|
intermediateStops.add(new Stop(location, position, time.getTime()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
XmlPullUtil.exit(pp, "BasicStop");
|
||||||
}
|
}
|
||||||
XmlPullUtil.exit(pp, "BasicStop");
|
|
||||||
|
XmlPullUtil.exit(pp, "PassList");
|
||||||
}
|
}
|
||||||
|
|
||||||
XmlPullUtil.exit(pp, "PassList");
|
|
||||||
XmlPullUtil.exit(pp, "Journey");
|
XmlPullUtil.exit(pp, "Journey");
|
||||||
|
|
||||||
if (category == null)
|
if (category == null)
|
||||||
|
@ -829,7 +835,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
XmlPullUtil.exit(pp, "Arrival");
|
XmlPullUtil.exit(pp, "Arrival");
|
||||||
|
|
||||||
// remove last intermediate
|
// remove last intermediate
|
||||||
final int size = intermediateStops.size();
|
final int size = intermediateStops != null ? intermediateStops.size() : 0;
|
||||||
if (size >= 1)
|
if (size >= 1)
|
||||||
if (intermediateStops.get(size - 1).location.id == sectionArrival.id)
|
if (intermediateStops.get(size - 1).location.id == sectionArrival.id)
|
||||||
intermediateStops.remove(size - 1);
|
intermediateStops.remove(size - 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue