Skip to content

Commit

Permalink
rename stopIndex to stopPositionInPattern
Browse files Browse the repository at this point in the history
stopIndex is considered an implementation detail in OTP which shouldn't be exposed, while stopPositionInPattern is guaranteed to run from 0 to n-1.
  • Loading branch information
miklcct committed Nov 5, 2024
1 parent 4b8dda8 commit b7d0dbe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ public DataFetcher<Integer> scheduledDeparture() {
}

@Override
public DataFetcher<Integer> stopIndex() {
return environment -> getSource(environment).getStopIndex();
public DataFetcher<Integer> stopPosition() {
return environment -> getSource(environment).getGtfsSequence();
}

@Override
public DataFetcher<Integer> stopPosition() {
return environment -> getSource(environment).getGtfsSequence();
public DataFetcher<Integer> stopPositionInPattern() {
return environment -> getSource(environment).getStopIndex();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1093,10 +1093,10 @@ public interface GraphQLStoptime {

public DataFetcher<Object> stop();

public DataFetcher<Integer> stopIndex();

public DataFetcher<Integer> stopPosition();

public DataFetcher<Integer> stopPositionInPattern();

public DataFetcher<Boolean> timepoint();

public DataFetcher<Trip> trip();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
package org.opentripplanner.apis.gtfs.generated;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2195,18 +2195,10 @@ type Stoptime {
"The stop where this arrival/departure happens"
stop: Stop
"""
The index of the stop in the pattern. This is required to start from 0 and be consecutive.
The purpose of this field is to identify the position of the stop within the pattern so it can be
cross-referenced between different trips on the same pattern, as stopPosition can be different
between trips even within the same pattern.
"""
stopIndex: Int!
"""
The sequence of the stop in the pattern. This is not required to start from 0 or be consecutive - any
The sequence of the stop in the trip. This is not required to start from 0 or be consecutive - any
increasing integer sequence along the stops is valid.
The purpose of this field is to identify the stop within the pattern so it can be cross-referenced
The purpose of this field is to identify the stop within the trip so it can be cross-referenced
between it and the itinerary. It is safe to cross-reference when done quickly, i.e. within seconds.
However, it should be noted that real-time updates can change the values, so don't store it for
longer amounts of time.
Expand All @@ -2215,6 +2207,15 @@ type Stoptime {
even generated.
"""
stopPosition: Int
"""
The position of the stop in the pattern. This is required to start from 0 and be consecutive along
the pattern, up to n-1 for a pattern with n stops.
The purpose of this field is to identify the position of the stop within the pattern so it can be
cross-referenced between different trips on the same pattern, as stopPosition can be different
between trips even within the same pattern.
"""
stopPositionInPattern: Int!
"true, if this stop is used as a time equalization stop. false otherwise."
timepoint: Boolean
"Trip which this stoptime is for"
Expand Down

0 comments on commit b7d0dbe

Please sign in to comment.