From 9e81f735abe03ff9efd61851a62a195a04c3cc0b Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Thu, 23 Nov 2023 13:20:18 +0100 Subject: [PATCH] Add getLocation --- .../main/java/org/onebusaway/gtfs/impl/StopTimeArray.java | 5 +++++ .../src/main/java/org/onebusaway/gtfs/model/StopTime.java | 7 +++++++ .../main/java/org/onebusaway/gtfs/model/StopTimeProxy.java | 3 +++ 3 files changed, 15 insertions(+) diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/StopTimeArray.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/StopTimeArray.java index 28b30445..c03a8e1c 100644 --- a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/StopTimeArray.java +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/StopTimeArray.java @@ -258,6 +258,11 @@ public StopLocation getStop() { return stops[index]; } + @Override + public StopLocation getLocation() { + return stops[index]; + } + @Override public void setStop(StopLocation stop) { stops[index] = stop; diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/StopTime.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/StopTime.java index bb122bf1..4db4c785 100644 --- a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/StopTime.java +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/StopTime.java @@ -282,6 +282,13 @@ public StopLocation getStop() { return Objects.requireNonNullElse(stop, location); } + public StopLocation getLocation() { + if (proxy != null) { + return proxy.getLocation(); + } + return location; + } + public void setStop(StopLocation stop) { if (proxy != null) { proxy.setStop(stop); diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/StopTimeProxy.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/StopTimeProxy.java index 728dc0a0..1cbc75af 100644 --- a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/StopTimeProxy.java +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/StopTimeProxy.java @@ -45,6 +45,8 @@ public interface StopTimeProxy { public StopLocation getStop(); + public StopLocation getLocation(); + public void setStop(StopLocation stop); public void setLocation(StopLocation stop); @@ -124,4 +126,5 @@ public interface StopTimeProxy { public String getFreeRunningFlag(); public void setFreeRunningFlag(String freeRunningFlag); + }