fixed parsing connections for Switzerland, ambiguous still missing

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@293 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-10-15 22:23:01 +00:00
parent 8a6b2a9ae3
commit 0a773096f0
8 changed files with 179 additions and 414 deletions

View file

@ -214,6 +214,17 @@ public abstract class AbstractHafasProvider implements NetworkProvider
return 0;
}
private static final Pattern P_CONNECTION_ID = Pattern.compile("co=(C\\d+-\\d+)&");
protected static String extractConnectionId(final String link)
{
final Matcher m = P_CONNECTION_ID.matcher(link);
if (m.find())
return m.group(1);
else
throw new IllegalArgumentException("cannot extract id from " + link);
}
private static final Map<Character, int[]> LINES = new HashMap<Character, int[]>();
static