Location now has constructor without geo coordinates

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@417 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2010-12-26 19:21:12 +00:00
parent a26e762a6b
commit e2b9bc96a9
23 changed files with 114 additions and 98 deletions

View file

@ -86,13 +86,13 @@ public class RmvProvider extends AbstractHafasProvider
final Matcher mSingle = P_SINGLE_NAME.matcher(page);
if (mSingle.matches())
{
results.add(new Location(LocationType.STATION, Integer.parseInt(mSingle.group(2)), 0, 0, ParserUtils.resolveEntities(mSingle.group(1))));
results.add(new Location(LocationType.STATION, Integer.parseInt(mSingle.group(2)), 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)), 0, 0, ParserUtils.resolveEntities(mMulti.group(2))));
results.add(new Location(LocationType.STATION, Integer.parseInt(mMulti.group(1)), ParserUtils.resolveEntities(mMulti.group(2))));
}
return results;
@ -199,7 +199,7 @@ public class RmvProvider extends AbstractHafasProvider
{
final String address = ParserUtils.resolveEntities(mAddresses.group(1)).trim();
if (!addresses.contains(address))
addresses.add(new Location(LocationType.ANY, 0, 0, 0, address + "!"));
addresses.add(new Location(LocationType.ANY, 0, address + "!"));
}
if (type == null)
@ -245,8 +245,8 @@ public class RmvProvider extends AbstractHafasProvider
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
if (mHead.matches())
{
final Location from = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(1)));
final Location to = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(2)));
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 Date currentDate = ParserUtils.parseDate(mHead.group(3));
final String linkEarlier = mHead.group(4) != null ? ParserUtils.resolveEntities(mHead.group(4)) : null;
final String linkLater = mHead.group(5) != null ? ParserUtils.resolveEntities(mHead.group(5)) : null;
@ -352,7 +352,7 @@ public class RmvProvider extends AbstractHafasProvider
{
final String line = normalizeLine(ParserUtils.resolveEntities(mDetFine.group(1)));
final Location destination = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mDetFine.group(2)));
final Location destination = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mDetFine.group(2)));
final Date departureTime = upTime(lastTime, ParserUtils.joinDateTime(currentDate, ParserUtils.parseTime(mDetFine.group(3))));
@ -527,7 +527,7 @@ public class RmvProvider extends AbstractHafasProvider
}
}
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, 0, 0, location), departures, null);
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, location), departures, null);
}
else
{