mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 16:59:51 +00:00
place in departures
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@447 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
612111edef
commit
2ae3bff64b
23 changed files with 135 additions and 105 deletions
|
@ -94,13 +94,13 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
final Matcher mSingle = P_SINGLE_NAME.matcher(page);
|
||||
if (mSingle.matches())
|
||||
{
|
||||
results.add(new Location(LocationType.STATION, Integer.parseInt(mSingle.group(2)), ParserUtils.resolveEntities(mSingle.group(1))));
|
||||
results.add(new Location(LocationType.STATION, Integer.parseInt(mSingle.group(2)), null, ParserUtils.resolveEntities(mSingle.group(1))));
|
||||
}
|
||||
else
|
||||
{
|
||||
final Matcher mMulti = P_MULTI_NAME.matcher(page);
|
||||
while (mMulti.find())
|
||||
results.add(new Location(LocationType.STATION, Integer.parseInt(mMulti.group(1)), ParserUtils.resolveEntities(mMulti.group(2))));
|
||||
results.add(new Location(LocationType.STATION, Integer.parseInt(mMulti.group(1)), null, ParserUtils.resolveEntities(mMulti.group(2))));
|
||||
}
|
||||
|
||||
return results;
|
||||
|
@ -304,7 +304,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
{
|
||||
final String address = ParserUtils.resolveEntities(mAddress.group(1));
|
||||
if (!addresses.contains(address))
|
||||
addresses.add(new Location(LocationType.ANY, 0, address + "!"));
|
||||
addresses.add(new Location(LocationType.ANY, 0, null, address + "!"));
|
||||
}
|
||||
|
||||
if (addresses.isEmpty())
|
||||
|
@ -364,8 +364,8 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
|
||||
if (mHead.matches())
|
||||
{
|
||||
final Location from = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(1)));
|
||||
final Location to = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(2)));
|
||||
final Location from = new Location(LocationType.ANY, 0, null, ParserUtils.resolveEntities(mHead.group(1)));
|
||||
final Location to = new Location(LocationType.ANY, 0, null, ParserUtils.resolveEntities(mHead.group(2)));
|
||||
final Date currentDate = ParserUtils.parseDate(mHead.group(3));
|
||||
final String linkEarlier = mHead.group(4) != null ? BVG_BASE_URL + ParserUtils.resolveEntities(mHead.group(4)) : null;
|
||||
final String linkLater = mHead.group(5) != null ? BVG_BASE_URL + ParserUtils.resolveEntities(mHead.group(5)) : null;
|
||||
|
@ -483,7 +483,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
|
||||
final String line = normalizeLine(ParserUtils.resolveEntities(mDetFine.group(5)));
|
||||
|
||||
final Location destination = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mDetFine.group(6)));
|
||||
final Location destination = new Location(LocationType.ANY, 0, null, ParserUtils.resolveEntities(mDetFine.group(6)));
|
||||
|
||||
Date arrivalTime = ParserUtils.joinDateTime(currentDate, ParserUtils.parseTime(mDetFine.group(7)));
|
||||
if (departureTime.after(arrivalTime))
|
||||
|
@ -662,7 +662,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
}
|
||||
}
|
||||
|
||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), location), departures, null);
|
||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location), departures, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -729,7 +729,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
}
|
||||
}
|
||||
|
||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), location), departures, null);
|
||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location), departures, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue