mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 23:38:48 +00:00
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:
parent
a26e762a6b
commit
e2b9bc96a9
23 changed files with 114 additions and 98 deletions
|
@ -873,7 +873,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
||||||
XmlPullUtil.exit(pp, "itdDepartureList");
|
XmlPullUtil.exit(pp, "itdDepartureList");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, 0, 0, location), departures, lines);
|
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, location), departures, lines);
|
||||||
}
|
}
|
||||||
else if ("notidentified".equals(nameState))
|
else if ("notidentified".equals(nameState))
|
||||||
{
|
{
|
||||||
|
@ -1182,8 +1182,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
||||||
final String destinationIdStr = pp.getAttributeValue(null, "destID");
|
final String destinationIdStr = pp.getAttributeValue(null, "destID");
|
||||||
final String destinationName = normalizeLocationName(pp.getAttributeValue(null, "destination"));
|
final String destinationName = normalizeLocationName(pp.getAttributeValue(null, "destination"));
|
||||||
final Location destination = destinationIdStr.length() > 0 ? new Location(LocationType.STATION,
|
final Location destination = destinationIdStr.length() > 0 ? new Location(LocationType.STATION,
|
||||||
Integer.parseInt(destinationIdStr), 0, 0, destinationName) : new Location(LocationType.ANY, 0, 0, 0,
|
Integer.parseInt(destinationIdStr), destinationName) : new Location(LocationType.ANY, 0, destinationName);
|
||||||
destinationName);
|
|
||||||
String line;
|
String line;
|
||||||
if ("AST".equals(pp.getAttributeValue(null, "symbol")))
|
if ("AST".equals(pp.getAttributeValue(null, "symbol")))
|
||||||
line = "BAST";
|
line = "BAST";
|
||||||
|
@ -1218,7 +1217,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
||||||
XmlPullUtil.require(pp, "itdDateTime");
|
XmlPullUtil.require(pp, "itdDateTime");
|
||||||
processItdDateTime(pp, stopTime);
|
processItdDateTime(pp, stopTime);
|
||||||
XmlPullUtil.exit(pp, "itdPoint");
|
XmlPullUtil.exit(pp, "itdPoint");
|
||||||
intermediateStops.add(new Stop(new Location(LocationType.STATION, stopId, 0, 0, stopName), stopPosition, stopTime
|
intermediateStops.add(new Stop(new Location(LocationType.STATION, stopId, stopName), stopPosition, stopTime
|
||||||
.getTime()));
|
.getTime()));
|
||||||
}
|
}
|
||||||
XmlPullUtil.exit(pp, "itdStopSeq");
|
XmlPullUtil.exit(pp, "itdStopSeq");
|
||||||
|
|
|
@ -123,7 +123,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
{
|
{
|
||||||
XmlPullUtil.requireAttr(pp, "type", "ADR");
|
XmlPullUtil.requireAttr(pp, "type", "ADR");
|
||||||
final String name = pp.getAttributeValue(null, "output").trim();
|
final String name = pp.getAttributeValue(null, "output").trim();
|
||||||
return new Location(LocationType.ADDRESS, 0, 0, 0, name);
|
return new Location(LocationType.ADDRESS, 0, name);
|
||||||
}
|
}
|
||||||
throw new IllegalStateException("cannot handle: " + type);
|
throw new IllegalStateException("cannot handle: " + type);
|
||||||
}
|
}
|
||||||
|
@ -424,7 +424,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
|
|
||||||
if (min == 0 || line != null)
|
if (min == 0 || line != null)
|
||||||
{
|
{
|
||||||
parts.add(new Connection.Trip(line, lineColors(line), new Location(LocationType.ANY, 0, 0, 0, direction), departureTime,
|
parts.add(new Connection.Trip(line, lineColors(line), new Location(LocationType.ANY, 0, direction), departureTime,
|
||||||
departurePos, sectionDeparture.id, sectionDeparture.name, arrivalTime, arrivalPos, sectionArrival.id,
|
departurePos, sectionDeparture.id, sectionDeparture.name, arrivalTime, arrivalPos, sectionArrival.id,
|
||||||
sectionArrival.name, null));
|
sectionArrival.name, null));
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,13 +81,13 @@ public final class BahnProvider extends AbstractHafasProvider
|
||||||
final Matcher mSingle = P_SINGLE_NAME.matcher(page);
|
final Matcher mSingle = P_SINGLE_NAME.matcher(page);
|
||||||
if (mSingle.matches())
|
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
|
else
|
||||||
{
|
{
|
||||||
final Matcher mMulti = P_MULTI_NAME.matcher(page);
|
final Matcher mMulti = P_MULTI_NAME.matcher(page);
|
||||||
while (mMulti.find())
|
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;
|
return results;
|
||||||
|
@ -189,7 +189,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
final String address = ParserUtils.resolveEntities(mAddresses.group(1)).trim();
|
final String address = ParserUtils.resolveEntities(mAddresses.group(1)).trim();
|
||||||
if (!addresses.contains(address))
|
if (!addresses.contains(address))
|
||||||
addresses.add(new Location(LocationType.ANY, 0, 0, 0, address + "!"));
|
addresses.add(new Location(LocationType.ANY, 0, address + "!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.equals("REQ0JourneyStopsS0K"))
|
if (type.equals("REQ0JourneyStopsS0K"))
|
||||||
|
@ -249,8 +249,8 @@ public final class BahnProvider extends AbstractHafasProvider
|
||||||
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
|
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
|
||||||
if (mHead.matches())
|
if (mHead.matches())
|
||||||
{
|
{
|
||||||
final Location from = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(1)));
|
final Location from = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(1)));
|
||||||
final Location to = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(2)));
|
final Location to = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(2)));
|
||||||
final Date currentDate = ParserUtils.parseDate(mHead.group(3));
|
final Date currentDate = ParserUtils.parseDate(mHead.group(3));
|
||||||
final String linkEarlier = mHead.group(4) != null ? ParserUtils.resolveEntities(mHead.group(4)) : null;
|
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;
|
final String linkLater = mHead.group(5) != null ? ParserUtils.resolveEntities(mHead.group(5)) : null;
|
||||||
|
@ -522,7 +522,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), 0, 0, null), departures, null);
|
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null), departures, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -93,13 +93,13 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
final Matcher mSingle = P_SINGLE_NAME.matcher(page);
|
final Matcher mSingle = P_SINGLE_NAME.matcher(page);
|
||||||
if (mSingle.matches())
|
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
|
else
|
||||||
{
|
{
|
||||||
final Matcher mMulti = P_MULTI_NAME.matcher(page);
|
final Matcher mMulti = P_MULTI_NAME.matcher(page);
|
||||||
while (mMulti.find())
|
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;
|
return results;
|
||||||
|
@ -279,7 +279,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
final String address = ParserUtils.resolveEntities(mAddress.group(1));
|
final String address = ParserUtils.resolveEntities(mAddress.group(1));
|
||||||
if (!addresses.contains(address))
|
if (!addresses.contains(address))
|
||||||
addresses.add(new Location(LocationType.ANY, 0, 0, 0, address + "!"));
|
addresses.add(new Location(LocationType.ANY, 0, address + "!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addresses.isEmpty())
|
if (addresses.isEmpty())
|
||||||
|
@ -339,8 +339,8 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
|
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
|
||||||
if (mHead.matches())
|
if (mHead.matches())
|
||||||
{
|
{
|
||||||
final Location from = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(1)));
|
final Location from = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(1)));
|
||||||
final Location to = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(2)));
|
final Location to = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(2)));
|
||||||
final Date currentDate = ParserUtils.parseDate(mHead.group(3));
|
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 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;
|
final String linkLater = mHead.group(5) != null ? BVG_BASE_URL + ParserUtils.resolveEntities(mHead.group(5)) : null;
|
||||||
|
@ -458,7 +458,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
final String line = normalizeLine(ParserUtils.resolveEntities(mDetFine.group(5)));
|
final String line = normalizeLine(ParserUtils.resolveEntities(mDetFine.group(5)));
|
||||||
|
|
||||||
final Location destination = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mDetFine.group(6)));
|
final Location destination = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mDetFine.group(6)));
|
||||||
|
|
||||||
Date arrivalTime = ParserUtils.joinDateTime(currentDate, ParserUtils.parseTime(mDetFine.group(7)));
|
Date arrivalTime = ParserUtils.joinDateTime(currentDate, ParserUtils.parseTime(mDetFine.group(7)));
|
||||||
if (departureTime.after(arrivalTime))
|
if (departureTime.after(arrivalTime))
|
||||||
|
@ -629,7 +629,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), 0, 0, location), departures, null);
|
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), location), departures, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class NasaProvider extends AbstractHafasProvider
|
||||||
private static final Pattern P_DEPARTURES_HEAD_COARSE = Pattern
|
private static final Pattern P_DEPARTURES_HEAD_COARSE = Pattern
|
||||||
.compile(
|
.compile(
|
||||||
".*?" //
|
".*?" //
|
||||||
+ "(?:" //
|
+ "(?:" //
|
||||||
+ "<table class=\"hafasResult\"[^>]*>(.+?)</table>.*?" //
|
+ "<table class=\"hafasResult\"[^>]*>(.+?)</table>.*?" //
|
||||||
+ "(?:<table cellspacing=\"0\" class=\"hafasResult\"[^>]*>(.+?)</table>|(verkehren an dieser Haltestelle keine))"//
|
+ "(?:<table cellspacing=\"0\" class=\"hafasResult\"[^>]*>(.+?)</table>|(verkehren an dieser Haltestelle keine))"//
|
||||||
+ "|(Eingabe kann nicht interpretiert)|(Verbindung zum Server konnte leider nicht hergestellt werden|kann vom Server derzeit leider nicht bearbeitet werden))" //
|
+ "|(Eingabe kann nicht interpretiert)|(Verbindung zum Server konnte leider nicht hergestellt werden|kann vom Server derzeit leider nicht bearbeitet werden))" //
|
||||||
|
@ -152,8 +152,8 @@ public class NasaProvider extends AbstractHafasProvider
|
||||||
if (mHeadFine.matches())
|
if (mHeadFine.matches())
|
||||||
{
|
{
|
||||||
final String location = ParserUtils.resolveEntities(mHeadFine.group(1));
|
final String location = ParserUtils.resolveEntities(mHeadFine.group(1));
|
||||||
final Date currentTime = ParserUtils.joinDateTime(ParserUtils.parseDate(mHeadFine.group(2)), ParserUtils
|
final Date currentTime = ParserUtils.joinDateTime(ParserUtils.parseDate(mHeadFine.group(2)),
|
||||||
.parseTime(mHeadFine.group(3)));
|
ParserUtils.parseTime(mHeadFine.group(3)));
|
||||||
final List<Departure> departures = new ArrayList<Departure>(8);
|
final List<Departure> departures = new ArrayList<Departure>(8);
|
||||||
String oldZebra = null;
|
String oldZebra = null;
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ public class NasaProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), 0, 0, location), departures, null);
|
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), location), departures, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@ package de.schildbach.pte;
|
||||||
public enum NetworkId
|
public enum NetworkId
|
||||||
{
|
{
|
||||||
// Germany
|
// Germany
|
||||||
DB, BVG, RMV, MVV, AVV, VMV, GVH, BSVAG, NASA, VVO, VMS, VGS, VRR, VRN, VVS, NALDO, DING, KVV,
|
DB, BVG, RMV, MVV, INVG, AVV, VMV, GVH, BSVAG, NASA, VVO, VMS, VGS, VRR, VRN, VVS, NALDO, DING, KVV,
|
||||||
|
|
||||||
// Austria
|
// Austria
|
||||||
OEBB, VOR, LINZ, SVV, IVB, STV,
|
OEBB, VOR, LINZ, SVV, IVB, STV,
|
||||||
|
@ -43,6 +43,9 @@ public enum NetworkId
|
||||||
// Slovenia
|
// Slovenia
|
||||||
MARIBOR,
|
MARIBOR,
|
||||||
|
|
||||||
|
// Italy
|
||||||
|
ATC,
|
||||||
|
|
||||||
// United Arab Emirates
|
// United Arab Emirates
|
||||||
DUB,
|
DUB,
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ public class NsProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), 0, 0, location), departures, null);
|
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), location), departures, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,6 +43,9 @@ import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
import de.schildbach.pte.exception.SessionExpiredException;
|
import de.schildbach.pte.exception.SessionExpiredException;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andreas Schildbach
|
||||||
|
*/
|
||||||
public class OebbProvider extends AbstractHafasProvider
|
public class OebbProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
public static final NetworkId NETWORK_ID = NetworkId.OEBB;
|
public static final NetworkId NETWORK_ID = NetworkId.OEBB;
|
||||||
|
@ -250,7 +253,7 @@ public class OebbProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
final String address = ParserUtils.resolveEntities(mAddresses.group(1)).trim();
|
final String address = ParserUtils.resolveEntities(mAddresses.group(1)).trim();
|
||||||
if (!addresses.contains(address))
|
if (!addresses.contains(address))
|
||||||
addresses.add(new Location(LocationType.ANY, 0, 0, 0, address + "!"));
|
addresses.add(new Location(LocationType.ANY, 0, address + "!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.equals("REQ0JourneyStopsS0K"))
|
if (type.equals("REQ0JourneyStopsS0K"))
|
||||||
|
@ -351,8 +354,8 @@ public class OebbProvider extends AbstractHafasProvider
|
||||||
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
|
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
|
||||||
if (mHead.matches())
|
if (mHead.matches())
|
||||||
{
|
{
|
||||||
final Location from = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(1)));
|
final Location from = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(1)));
|
||||||
final Location to = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(2)));
|
final Location to = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(2)));
|
||||||
final Date currentDate = ParserUtils.parseDate(mHead.group(3));
|
final Date currentDate = ParserUtils.parseDate(mHead.group(3));
|
||||||
final String linkEarlier = mHead.group(4) != null ? ParserUtils.resolveEntities(mHead.group(4)) : null;
|
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;
|
final String linkLater = mHead.group(5) != null ? ParserUtils.resolveEntities(mHead.group(5)) : null;
|
||||||
|
@ -540,7 +543,7 @@ public class OebbProvider 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);
|
||||||
}
|
}
|
||||||
catch (final JSONException x)
|
catch (final JSONException x)
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,13 +86,13 @@ public class RmvProvider extends AbstractHafasProvider
|
||||||
final Matcher mSingle = P_SINGLE_NAME.matcher(page);
|
final Matcher mSingle = P_SINGLE_NAME.matcher(page);
|
||||||
if (mSingle.matches())
|
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
|
else
|
||||||
{
|
{
|
||||||
final Matcher mMulti = P_MULTI_NAME.matcher(page);
|
final Matcher mMulti = P_MULTI_NAME.matcher(page);
|
||||||
while (mMulti.find())
|
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;
|
return results;
|
||||||
|
@ -199,7 +199,7 @@ public class RmvProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
final String address = ParserUtils.resolveEntities(mAddresses.group(1)).trim();
|
final String address = ParserUtils.resolveEntities(mAddresses.group(1)).trim();
|
||||||
if (!addresses.contains(address))
|
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)
|
if (type == null)
|
||||||
|
@ -245,8 +245,8 @@ public class RmvProvider extends AbstractHafasProvider
|
||||||
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
|
final Matcher mHead = P_CONNECTIONS_HEAD.matcher(page);
|
||||||
if (mHead.matches())
|
if (mHead.matches())
|
||||||
{
|
{
|
||||||
final Location from = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(1)));
|
final Location from = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(1)));
|
||||||
final Location to = new Location(LocationType.ANY, 0, 0, 0, ParserUtils.resolveEntities(mHead.group(2)));
|
final Location to = new Location(LocationType.ANY, 0, ParserUtils.resolveEntities(mHead.group(2)));
|
||||||
final Date currentDate = ParserUtils.parseDate(mHead.group(3));
|
final Date currentDate = ParserUtils.parseDate(mHead.group(3));
|
||||||
final String linkEarlier = mHead.group(4) != null ? ParserUtils.resolveEntities(mHead.group(4)) : null;
|
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;
|
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 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))));
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class SbbProvider extends AbstractHafasProvider
|
||||||
+ "|(Verbindung zum Server konnte leider nicht hergestellt werden|kann vom Server derzeit leider nicht bearbeitet werden)" // messages
|
+ "|(Verbindung zum Server konnte leider nicht hergestellt werden|kann vom Server derzeit leider nicht bearbeitet werden)" // messages
|
||||||
+ ").*?" //
|
+ ").*?" //
|
||||||
, Pattern.DOTALL);
|
, Pattern.DOTALL);
|
||||||
private static final Pattern P_DEPARTURES_HEAD_FINE = Pattern.compile("" //
|
private static final Pattern P_DEPARTURES_HEAD_FINE = Pattern.compile("" //
|
||||||
+ "<strong>([^<]*)</strong>(?:<br />)?\n" // location
|
+ "<strong>([^<]*)</strong>(?:<br />)?\n" // location
|
||||||
+ "Abfahrt (\\d{1,2}:\\d{2})\n" // time
|
+ "Abfahrt (\\d{1,2}:\\d{2})\n" // time
|
||||||
+ "Uhr, (\\d{2}\\.\\d{2}\\.\\d{2})\n" // date
|
+ "Uhr, (\\d{2}\\.\\d{2}\\.\\d{2})\n" // date
|
||||||
|
@ -134,8 +134,8 @@ public class SbbProvider extends AbstractHafasProvider
|
||||||
if (mHeadFine.matches())
|
if (mHeadFine.matches())
|
||||||
{
|
{
|
||||||
final String location = ParserUtils.resolveEntities(mHeadFine.group(1));
|
final String location = ParserUtils.resolveEntities(mHeadFine.group(1));
|
||||||
final Date currentTime = ParserUtils.joinDateTime(ParserUtils.parseDate(mHeadFine.group(3)), ParserUtils
|
final Date currentTime = ParserUtils.joinDateTime(ParserUtils.parseDate(mHeadFine.group(3)),
|
||||||
.parseTime(mHeadFine.group(2)));
|
ParserUtils.parseTime(mHeadFine.group(2)));
|
||||||
final int locationId = Integer.parseInt(mHeadFine.group(4));
|
final int locationId = Integer.parseInt(mHeadFine.group(4));
|
||||||
final List<Departure> departures = new ArrayList<Departure>(8);
|
final List<Departure> departures = new ArrayList<Departure>(8);
|
||||||
// String oldZebra = null;
|
// String oldZebra = null;
|
||||||
|
@ -180,7 +180,7 @@ public class SbbProvider 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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -161,7 +161,7 @@ public class SncbProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), 0, 0, location), departures, null);
|
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), location), departures, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -212,7 +212,7 @@ public class VgsProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), 0, 0, location), departures, null);
|
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), location), departures, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.dto;
|
package de.schildbach.pte.dto;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -37,6 +38,15 @@ public final class Location implements Serializable
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location(final LocationType type, final int id, final String name)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
this.id = id;
|
||||||
|
this.lat = 0;
|
||||||
|
this.lon = 0;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,7 +45,7 @@ public final class QueryDeparturesResult
|
||||||
public QueryDeparturesResult(final Status status, final int locationId)
|
public QueryDeparturesResult(final Status status, final int locationId)
|
||||||
{
|
{
|
||||||
this.status = status;
|
this.status = status;
|
||||||
this.location = new Location(LocationType.STATION, locationId, 0, 0, null);
|
this.location = new Location(LocationType.STATION, locationId, null);
|
||||||
this.departures = null;
|
this.departures = null;
|
||||||
this.lines = null;
|
this.lines = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,8 @@ public class BahnProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Berlin"), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Berlin"), null, new Location(
|
||||||
LocationType.ANY, 0, 0, 0, "Leipzig"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
LocationType.ANY, 0, "Leipzig"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
for (final Connection connection : result.connections)
|
for (final Connection connection : result.connections)
|
||||||
|
@ -59,8 +59,8 @@ public class BahnProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void slowConnection() throws Exception
|
public void slowConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Marienburger Str., Berlin"), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Marienburger Str., Berlin"), null,
|
||||||
new Location(LocationType.ANY, 0, 0, 0, "Tutzinger-Hof-Platz, Starnberg"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
new Location(LocationType.ANY, 0, "Tutzinger-Hof-Platz, Starnberg"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
for (final Connection connection : result.connections)
|
for (final Connection connection : result.connections)
|
||||||
|
@ -71,9 +71,8 @@ public class BahnProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void connectionWithFootway() throws Exception
|
public void connectionWithFootway() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 0, 0,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, "Berlin - Mitte, Unter den Linden 24"),
|
||||||
"Berlin - Mitte, Unter den Linden 24"), null, new Location(LocationType.ADDRESS, 0, 0, 0, "Starnberg, Possenhofener Straße 13"),
|
null, new Location(LocationType.ADDRESS, 0, "Starnberg, Possenhofener Straße 13"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
|
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -87,8 +88,8 @@ public class GvhProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void incompleteConnection() throws Exception
|
public void incompleteConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "hann"), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "hann"), null, new Location(
|
||||||
LocationType.ANY, 0, 0, 0, "laat"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST);
|
LocationType.ANY, 0, "laat"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +97,7 @@ public class GvhProviderLiveTest
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 25000031, 0, 0, "Hannover Hauptbahnhof"),
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 25000031, 0, 0, "Hannover Hauptbahnhof"),
|
||||||
null, new Location(LocationType.STATION, 25001141, 0, 0, "Hannover Bismarckstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST);
|
null, new Location(LocationType.STATION, 25001141, "Hannover Bismarckstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,16 +79,16 @@ public class LinzProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void incompleteConnection() throws Exception
|
public void incompleteConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "linz"), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "linz"), null, new Location(
|
||||||
LocationType.ANY, 0, 0, 0, "gel"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST);
|
LocationType.ANY, 0, "gel"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 0, 0, 0, "Linz Hauptbahnhof"), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 0, "Linz Hauptbahnhof"), null,
|
||||||
new Location(LocationType.STATION, 0, 0, 0, "Linz Auwiesen"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST);
|
new Location(LocationType.STATION, 0, "Linz Auwiesen"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
@ -97,8 +97,8 @@ public class LinzProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void longConnection() throws Exception
|
public void longConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 0, 0, 0, "Linz Auwiesen"), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 0, "Linz Auwiesen"), null, new Location(
|
||||||
new Location(LocationType.STATION, 0, 0, 0, "Linz Hafen"), new Date(), true, ALL_PRODUCTS, WalkSpeed.SLOW);
|
LocationType.STATION, 0, "Linz Hafen"), new Date(), true, ALL_PRODUCTS, WalkSpeed.SLOW);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
// System.out.println(moreResult);
|
// System.out.println(moreResult);
|
||||||
|
|
|
@ -38,8 +38,8 @@ public class MvvProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Marienplatz"), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Marienplatz"), null, new Location(
|
||||||
LocationType.ANY, 0, 0, 0, "Pasing"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
LocationType.ANY, 0, "Pasing"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
@ -48,8 +48,8 @@ public class MvvProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void longConnection() throws Exception
|
public void longConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Starnberg, Arbeitsamt"), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Starnberg, Arbeitsamt"), null,
|
||||||
new Location(LocationType.STATION, 0, 0, 0, "Ackermannstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
new Location(LocationType.STATION, 0, "Ackermannstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
// seems like there are no more connections all the time
|
// seems like there are no more connections all the time
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ public class MvvProviderLiveTest
|
||||||
public void connectionBetweenCoordinateAndStation() throws Exception
|
public void connectionBetweenCoordinateAndStation() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 48238341, 11478230, null), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 48238341, 11478230, null), null,
|
||||||
new Location(LocationType.ANY, 0, 0, 0, "Ostbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
new Location(LocationType.ANY, 0, "Ostbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
@ -77,8 +77,8 @@ public class MvvProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void connectionBetweenAddresses() throws Exception
|
public void connectionBetweenAddresses() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 0, 0, "München, Maximilianstr. 1"),
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, "München, Maximilianstr. 1"), null,
|
||||||
null, new Location(LocationType.ADDRESS, 0, 0, 0, "Starnberg, Jahnstraße 50"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
new Location(LocationType.ADDRESS, 0, "Starnberg, Jahnstraße 50"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
@ -87,9 +87,8 @@ public class MvvProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void connectionBetweenStationAndAddress() throws Exception
|
public void connectionBetweenStationAndAddress() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 1220, 0, 0, "Josephsburg"), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 1220, "Josephsburg"), null, new Location(
|
||||||
new Location(LocationType.ADDRESS, 0, 48188018, 11574239, "München Frankfurter Ring 35"), new Date(), true, ALL_PRODUCTS,
|
LocationType.ADDRESS, 0, 48188018, 11574239, "München Frankfurter Ring 35"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
WalkSpeed.NORMAL);
|
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -43,7 +44,7 @@ public class NsProviderLiveTest
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.departures.size() + " " + result.departures);
|
System.out.println(result.status + " " + result.departures.size() + " " + result.departures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void autocompleteIncomplete() throws Exception
|
public void autocompleteIncomplete() throws Exception
|
||||||
{
|
{
|
||||||
|
@ -63,8 +64,8 @@ public class NsProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024, 0, 0, null), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024, null), null, new Location(
|
||||||
LocationType.STATION, 100066, 0, 0, null), new Date(), true, null, WalkSpeed.FAST);
|
LocationType.STATION, 100066, null), new Date(), true, null, WalkSpeed.FAST);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.connections);
|
System.out.println(result.status + " " + result.connections);
|
||||||
}
|
}
|
||||||
|
@ -72,8 +73,8 @@ public class NsProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void longConnection() throws Exception
|
public void longConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024, 0, 0, null), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024, null), null, new Location(
|
||||||
LocationType.STATION, 103624, 0, 0, null), new Date(), true, null, WalkSpeed.FAST);
|
LocationType.STATION, 103624, null), new Date(), true, null, WalkSpeed.FAST);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.connections);
|
System.out.println(result.status + " " + result.connections);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,8 @@ import java.util.Date;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import de.schildbach.pte.OebbProvider;
|
|
||||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||||
|
import de.schildbach.pte.OebbProvider;
|
||||||
import de.schildbach.pte.dto.Location;
|
import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||||
|
@ -47,8 +47,8 @@ public class OebbProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Linz"), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Linz"), null, new Location(
|
||||||
LocationType.ANY, 0, 0, 0, "Berlin"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
LocationType.ANY, 0, "Berlin"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
@ -57,8 +57,8 @@ public class OebbProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void slowConnection() throws Exception
|
public void slowConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Ramsen, Zoll"), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Ramsen, Zoll"), null, new Location(
|
||||||
LocationType.ANY, 0, 0, 0, "Azuga"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
LocationType.ANY, 0, "Azuga"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
@ -67,8 +67,8 @@ public class OebbProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void connectionWithFootway() throws Exception
|
public void connectionWithFootway() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Graz, Haselweg"), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Graz, Haselweg"), null, new Location(
|
||||||
new Location(LocationType.ADDRESS, 0, 0, 0, "Innsbruck, Gumppstraße 69"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
LocationType.ADDRESS, 0, "Innsbruck, Gumppstraße 69"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
@ -77,9 +77,8 @@ public class OebbProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void connectionWithFootway2() throws Exception
|
public void connectionWithFootway2() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Wien, Krottenbachstraße 110!"), null,
|
||||||
.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Wien, Krottenbachstraße 110!"), null, new Location(LocationType.ADDRESS,
|
new Location(LocationType.ADDRESS, 0, "Wien, Meidlinger Hauptstraße 1"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
0, 0, 0, "Wien, Meidlinger Hauptstraße 1"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
|
|
@ -22,8 +22,8 @@ import java.util.List;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import de.schildbach.pte.SbbProvider;
|
|
||||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||||
|
import de.schildbach.pte.SbbProvider;
|
||||||
import de.schildbach.pte.dto.Location;
|
import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||||
|
@ -73,8 +73,8 @@ public class SbbProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 8503000, 0, 0, "Zürich HB"), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 8503000, "Zürich HB"), null, new Location(
|
||||||
new Location(LocationType.STATION, 8507785, 0, 0, "Bern, Hauptbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
LocationType.STATION, 8507785, "Bern, Hauptbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
@ -83,8 +83,8 @@ public class SbbProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void slowConnection() throws Exception
|
public void slowConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Schocherswil, Alte Post!"), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Schocherswil, Alte Post!"), null,
|
||||||
new Location(LocationType.ANY, 0, 0, 0, "Laconnex, Mollach"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
new Location(LocationType.ANY, 0, "Laconnex, Mollach"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
@ -93,8 +93,8 @@ public class SbbProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void connectionWithFootway() throws Exception
|
public void connectionWithFootway() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 0, 0, "Spiez, Seestraße 62"), null,
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, "Spiez, Seestraße 62"), null,
|
||||||
new Location(LocationType.ADDRESS, 0, 0, 0, "Einsiedeln, Erlenmoosweg 24"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
new Location(LocationType.ADDRESS, 0, "Einsiedeln, Erlenmoosweg 24"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -21,8 +22,8 @@ import java.util.List;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import de.schildbach.pte.SncbProvider;
|
|
||||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||||
|
import de.schildbach.pte.SncbProvider;
|
||||||
import de.schildbach.pte.dto.Location;
|
import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||||
|
@ -43,7 +44,7 @@ public class SncbProviderLiveTest
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.departures.size() + " " + result.departures);
|
System.out.println(result.status + " " + result.departures.size() + " " + result.departures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void autocompleteIncomplete() throws Exception
|
public void autocompleteIncomplete() throws Exception
|
||||||
{
|
{
|
||||||
|
@ -63,8 +64,8 @@ public class SncbProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024, 0, 0, null), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024, null), null, new Location(
|
||||||
LocationType.STATION, 100066, 0, 0, null), new Date(), true, null, WalkSpeed.FAST);
|
LocationType.STATION, 100066, null), new Date(), true, null, WalkSpeed.FAST);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.connections);
|
System.out.println(result.status + " " + result.connections);
|
||||||
}
|
}
|
||||||
|
@ -72,8 +73,8 @@ public class SncbProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void longConnection() throws Exception
|
public void longConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024, 0, 0, null), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024, null), null, new Location(
|
||||||
LocationType.STATION, 103624, 0, 0, null), new Date(), true, null, WalkSpeed.FAST);
|
LocationType.STATION, 103624, null), new Date(), true, null, WalkSpeed.FAST);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.connections);
|
System.out.println(result.status + " " + result.connections);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -55,7 +56,7 @@ public class TflProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void postcodeConnection() throws Exception
|
public void postcodeConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "sw19 8ta"), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "sw19 8ta"), null, new Location(
|
||||||
LocationType.STATION, 1016019, 51655903, -397249, "Watford (Herts), Watford Town Centre"), new Date(), true, ALL_PRODUCTS,
|
LocationType.STATION, 1016019, 51655903, -397249, "Watford (Herts), Watford Town Centre"), new Date(), true, ALL_PRODUCTS,
|
||||||
WalkSpeed.NORMAL);
|
WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue