Skip to content

Commit

Permalink
Lessen feature envy
Browse files Browse the repository at this point in the history
  • Loading branch information
optionsome committed Feb 17, 2023
1 parent 507716c commit fb866cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ private boolean containsSameStopsAsOriginalPattern() {
* Helper method for getting the trip headsign from the {@link TripTimes}.
*/
private I18NString getTripHeadSignFromTripTimes(TripTimes tripTimes) {
return tripTimes != null ? tripTimes.getTrip().getHeadsign() : null;
return tripTimes != null ? tripTimes.getTripHeadsign() : null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ public List<String> getHeadsignVias(final int stop) {
return List.of(headsignVias[stop]);
}

/**
* @return the whole trip's headsign. Individual stops can have different headsigns.
*/
public I18NString getTripHeadsign() {
return trip.getHeadsign();
}

/** @return the time in seconds after midnight that the vehicle arrives at the stop. */
public int getScheduledArrivalTime(final int stop) {
return scheduledArrivalTimes[stop] + timeShift;
Expand Down

0 comments on commit fb866cb

Please sign in to comment.