Switch to modern code format. Organize imports. No functional changes.

Java sources use Eclipse 4.5 'Java Conventions' with indentation changed to 4 spaces only per level.
This commit is contained in:
Andreas Schildbach 2016-09-08 17:52:19 +02:00
parent db59817a05
commit 931dafb628
191 changed files with 24827 additions and 27703 deletions

View file

@ -36,22 +36,20 @@ import de.schildbach.pte.dto.SuggestLocationsResult;
* @author Andreas Schildbach
*/
@Controller
public class LocationController
{
private final RtProvider provider = new RtProvider();
public class LocationController {
private final RtProvider provider = new RtProvider();
@RequestMapping(value = "/location/suggest", method = RequestMethod.GET)
@ResponseBody
public SuggestLocationsResult suggest(@RequestParam("q") final String query) throws IOException
{
return provider.suggestLocations(query);
}
@RequestMapping(value = "/location/suggest", method = RequestMethod.GET)
@ResponseBody
public SuggestLocationsResult suggest(@RequestParam("q") final String query) throws IOException {
return provider.suggestLocations(query);
}
@RequestMapping(value = "/location/nearby", method = RequestMethod.GET)
@ResponseBody
public NearbyLocationsResult nearby(@RequestParam("lat") final int lat, @RequestParam("lon") final int lon) throws IOException
{
final Location coord = Location.coord(lat, lon);
return provider.queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), coord, 5000, 100);
}
@RequestMapping(value = "/location/nearby", method = RequestMethod.GET)
@ResponseBody
public NearbyLocationsResult nearby(@RequestParam("lat") final int lat, @RequestParam("lon") final int lon)
throws IOException {
final Location coord = Location.coord(lat, lon);
return provider.queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), coord, 5000, 100);
}
}

View file

@ -38,21 +38,21 @@ import de.schildbach.pte.dto.QueryTripsResult;
* @author Andreas Schildbach
*/
@Controller
public class TripController
{
private final RtProvider provider = new RtProvider();
public class TripController {
private final RtProvider provider = new RtProvider();
@RequestMapping(value = "/trip", method = RequestMethod.GET)
@ResponseBody
public QueryTripsResult trip(@RequestParam(value = "fromType", required = false, defaultValue = "ANY") final LocationType fromType,
@RequestParam(value = "from", required = false) final String from,
@RequestParam(value = "fromId", required = false) final String fromId,
@RequestParam(value = "toType", required = false, defaultValue = "ANY") final LocationType toType,
@RequestParam(value = "to", required = false) final String to,
@RequestParam(value = "toId", required = false) final String toId) throws IOException
{
final Location fromLocation = new Location(fromType, fromId, null, from);
final Location toLocation = new Location(toType, toId, null, to);
return provider.queryTrips(fromLocation, null, toLocation, new Date(), true, Product.ALL, null, WalkSpeed.NORMAL, Accessibility.NEUTRAL, null);
}
@RequestMapping(value = "/trip", method = RequestMethod.GET)
@ResponseBody
public QueryTripsResult trip(
@RequestParam(value = "fromType", required = false, defaultValue = "ANY") final LocationType fromType,
@RequestParam(value = "from", required = false) final String from,
@RequestParam(value = "fromId", required = false) final String fromId,
@RequestParam(value = "toType", required = false, defaultValue = "ANY") final LocationType toType,
@RequestParam(value = "to", required = false) final String to,
@RequestParam(value = "toId", required = false) final String toId) throws IOException {
final Location fromLocation = new Location(fromType, fromId, null, from);
final Location toLocation = new Location(toType, toId, null, to);
return provider.queryTrips(fromLocation, null, toLocation, new Date(), true, Product.ALL, null,
WalkSpeed.NORMAL, Accessibility.NEUTRAL, null);
}
}