mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-20 01:10:02 +00:00
migrated old network ids to new enum based ids
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@402 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
90cf8234b7
commit
e6c560a4f4
36 changed files with 284 additions and 50 deletions
|
@ -38,17 +38,22 @@ import de.schildbach.pte.util.ParserUtils;
|
|||
*/
|
||||
public class SncbProvider extends AbstractHafasProvider
|
||||
{
|
||||
public static final String NETWORK_ID = "hari.b-rail.be";
|
||||
public static final NetworkId NETWORK_ID = NetworkId.SNCB;
|
||||
public static final String OLD_NETWORK_ID = "hari.b-rail.be";
|
||||
private static final String API_URI = "http://hari.b-rail.be/Hafas/bin/extxml.exe";
|
||||
|
||||
private static final long PARSER_DAY_ROLLOVER_THRESHOLD_MS = 12 * 60 * 60 * 1000;
|
||||
|
||||
private static final String API_URI = "http://hari.b-rail.be/Hafas/bin/extxml.exe";
|
||||
|
||||
public SncbProvider()
|
||||
{
|
||||
super(API_URI, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
}
|
||||
|
||||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
|
@ -86,7 +91,7 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
+ "(.*?)\r\n</div>" // departures
|
||||
+ "|(Eingabe kann nicht interpretiert)|(Verbindung zum Server konnte leider nicht hergestellt werden))" //
|
||||
+ ".*?", 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 />\r\n" // location
|
||||
+ "Abfahrt (\\d{1,2}:\\d{2}),\r\n" // time
|
||||
+ "(\\d{2}/\\d{2}/\\d{2})" // date
|
||||
|
@ -119,8 +124,8 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
if (mHeadFine.matches())
|
||||
{
|
||||
final String location = ParserUtils.resolveEntities(mHeadFine.group(1));
|
||||
final Date currentTime = ParserUtils.joinDateTime(ParserUtils.parseDateSlash(mHeadFine.group(3)), ParserUtils.parseTime(mHeadFine
|
||||
.group(2)));
|
||||
final Date currentTime = ParserUtils.joinDateTime(ParserUtils.parseDateSlash(mHeadFine.group(3)),
|
||||
ParserUtils.parseTime(mHeadFine.group(2)));
|
||||
final List<Departure> departures = new ArrayList<Departure>(8);
|
||||
|
||||
final Matcher mDepCoarse = P_DEPARTURES_COARSE.matcher(mHeadCoarse.group(2));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue