Skip to content

Commit fb866cb

Browse files
committed
Lessen feature envy
1 parent 507716c commit fb866cb

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/org/opentripplanner/transit/model/network/TripPattern.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ private boolean containsSameStopsAsOriginalPattern() {
486486
* Helper method for getting the trip headsign from the {@link TripTimes}.
487487
*/
488488
private I18NString getTripHeadSignFromTripTimes(TripTimes tripTimes) {
489-
return tripTimes != null ? tripTimes.getTrip().getHeadsign() : null;
489+
return tripTimes != null ? tripTimes.getTripHeadsign() : null;
490490
}
491491

492492
/**

src/main/java/org/opentripplanner/transit/model/timetable/TripTimes.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ public List<String> getHeadsignVias(final int stop) {
212212
return List.of(headsignVias[stop]);
213213
}
214214

215+
/**
216+
* @return the whole trip's headsign. Individual stops can have different headsigns.
217+
*/
218+
public I18NString getTripHeadsign() {
219+
return trip.getHeadsign();
220+
}
221+
215222
/** @return the time in seconds after midnight that the vehicle arrives at the stop. */
216223
public int getScheduledArrivalTime(final int stop) {
217224
return scheduledArrivalTimes[stop] + timeShift;

0 commit comments

Comments
 (0)