Skip to content

Commit

Permalink
STYLE: NAV-18 - Add blank lines after class headers
Browse files Browse the repository at this point in the history
  • Loading branch information
munterfi committed May 7, 2024
1 parent 3dfcb05 commit 45e1ed1
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class GtfsScheduleReader {
private static void readFromDirectory(File directory, GtfsScheduleParser parser) throws IOException {
for (GtfsScheduleFile fileType : GtfsScheduleFile.values()) {
File csvFile = new File(directory, fileType.getFileName());

if (csvFile.exists()) {
log.info("Reading GTFS CSV file: {}", csvFile.getAbsolutePath());
readCsvFile(csvFile, parser, fileType);
Expand All @@ -51,6 +52,7 @@ private static void readFromZip(File zipFile, GtfsScheduleParser parser) throws
try (ZipFile zf = new ZipFile(zipFile, StandardCharsets.UTF_8)) {
for (GtfsScheduleFile fileType : GtfsScheduleFile.values()) {
ZipEntry entry = zf.getEntry(fileType.getFileName());

if (entry != null) {
log.info("Reading GTFS file from ZIP: {}", entry.getName());
try (InputStreamReader reader = new InputStreamReader(BOMInputStream.builder()
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ch/naviqore/gtfs/schedule/model/Route.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
@Getter
public final class Route implements Initializable {

private final String id;
private final Agency agency;
private final String shortName;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ch/naviqore/gtfs/schedule/model/Stop.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
@Getter
public final class Stop implements Initializable {

private final String id;
private final String name;
private final Coordinate coordinate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
@Getter
public class Transfer {

private final Stop fromStop;
private final Stop toStop;
private final TransferType transferType;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ch/naviqore/gtfs/schedule/model/Trip.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@RequiredArgsConstructor
@Getter
public final class Trip implements Comparable<Trip>, Initializable {

private final String id;
private final Route route;
private final Calendar calendar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public interface RouteType {
* @throws NumberFormatException if the code is not a valid integer
* @throws IllegalArgumentException if the code is negative or invalid
*/

static RouteType parse(String code) {
return parse(Integer.parseInt(code));
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ch/naviqore/raptor/GtfsRoutePartitioner.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
@Log4j2
public class GtfsRoutePartitioner {

private final Map<Route, Map<String, SubRoute>> subRoutes = new HashMap<>();

public GtfsRoutePartitioner(GtfsSchedule schedule) {
Expand Down Expand Up @@ -48,6 +49,7 @@ private List<Stop> extractStopSequence(Trip trip) {
for (StopTime stopTime : trip.getStopTimes()) {
sequence.add(stopTime.stop());
}

return sequence;
}

Expand All @@ -56,6 +58,7 @@ public List<SubRoute> getSubRoutes(Route route) {
if (currentSubRoutes == null) {
throw new IllegalArgumentException("Route " + route.getId() + " not found in schedule");
}

return new ArrayList<>(currentSubRoutes.values());
}

Expand All @@ -65,6 +68,7 @@ public SubRoute getSubRoute(Trip trip) {
throw new IllegalArgumentException("Trip " + trip.getId() + " not found in schedule");
}
String key = generateStopSequenceKey(trip);

return currentSubRoutes.get(key);
}

Expand Down
1 change: 1 addition & 0 deletions src/test/java/ch/naviqore/BenchmarkData.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Log4j2
final class BenchmarkData {

private static final Path DATA_DIRECTORY = Path.of("benchmark/input");
private static final HttpClient httpClient = HttpClient.newBuilder()
.followRedirects(HttpClient.Redirect.ALWAYS)
Expand Down

0 comments on commit 45e1ed1

Please sign in to comment.