mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 16:59:51 +00:00
nearbyStations() gets its own result object
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@237 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
ae3cc77277
commit
94d99f7e53
18 changed files with 115 additions and 70 deletions
|
@ -33,6 +33,7 @@ import java.util.regex.Pattern;
|
|||
import de.schildbach.pte.dto.Autocomplete;
|
||||
import de.schildbach.pte.dto.Connection;
|
||||
import de.schildbach.pte.dto.GetConnectionDetailsResult;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||
import de.schildbach.pte.dto.Station;
|
||||
import de.schildbach.pte.dto.StationLocationResult;
|
||||
|
@ -133,7 +134,7 @@ public class MvvProvider extends AbstractEfaProvider
|
|||
private static final Pattern P_NEARBY_FINE = Pattern.compile(".*?<n>(.*?)</n>.*?<r>.*?<id>(.*?)</id>.*?</r>.*?(?:<c>(\\d+),(\\d+)</c>.*?)?");
|
||||
|
||||
@Override
|
||||
public List<Station> nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
{
|
||||
String uri;
|
||||
|
@ -169,9 +170,9 @@ public class MvvProvider extends AbstractEfaProvider
|
|||
}
|
||||
|
||||
if (maxStations == 0 || maxStations >= stations.size())
|
||||
return stations;
|
||||
return new NearbyStationsResult(uri, stations);
|
||||
else
|
||||
return stations.subList(0, maxStations);
|
||||
return new NearbyStationsResult(uri, stations.subList(0, maxStations));
|
||||
}
|
||||
|
||||
public StationLocationResult stationLocation(final String stationId) throws IOException
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue