mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 00:39:58 +00:00
autocomplete parses stationid where possible
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@129 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
d0162ed846
commit
c632118a6e
6 changed files with 36 additions and 19 deletions
|
@ -66,13 +66,13 @@ public class SbbProvider implements NetworkProvider
|
|||
final Matcher mSingle = P_SINGLE_NAME.matcher(page);
|
||||
if (mSingle.matches())
|
||||
{
|
||||
results.add(new Autocomplete(0, ParserUtils.resolveEntities(mSingle.group(1))));
|
||||
results.add(new Autocomplete(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 Autocomplete(0, ParserUtils.resolveEntities(mMulti.group(2))));
|
||||
results.add(new Autocomplete(Integer.parseInt(mMulti.group(1)), ParserUtils.resolveEntities(mMulti.group(2))));
|
||||
}
|
||||
|
||||
return results;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue