From 2497b10e7211b626c3d81f1252f2d5b45d05dc1a Mon Sep 17 00:00:00 2001 From: Merhatsidk Ayele Date: Mon, 15 May 2023 11:53:02 -0400 Subject: [PATCH] added ArrivalAndDepartureFilterByPredictedArrivalTime to filter the bean that has predictedArrival time in the past. --- .../src/main/resources/data-sources.xml | 12 ++++++++++++ ...valAndDepartureFilterByPredictedArrivalTime.java | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 onebusaway-transit-data/src/main/java/org/onebusaway/transit_data/model/ArrivalAndDepartureFilterByPredictedArrivalTime.java diff --git a/onebusaway-api-webapp/src/main/resources/data-sources.xml b/onebusaway-api-webapp/src/main/resources/data-sources.xml index 5e87142aa8..7f9d069893 100644 --- a/onebusaway-api-webapp/src/main/resources/data-sources.xml +++ b/onebusaway-api-webapp/src/main/resources/data-sources.xml @@ -86,4 +86,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/onebusaway-transit-data/src/main/java/org/onebusaway/transit_data/model/ArrivalAndDepartureFilterByPredictedArrivalTime.java b/onebusaway-transit-data/src/main/java/org/onebusaway/transit_data/model/ArrivalAndDepartureFilterByPredictedArrivalTime.java new file mode 100644 index 0000000000..a1b367c628 --- /dev/null +++ b/onebusaway-transit-data/src/main/java/org/onebusaway/transit_data/model/ArrivalAndDepartureFilterByPredictedArrivalTime.java @@ -0,0 +1,13 @@ +package org.onebusaway.transit_data.model; + +public class ArrivalAndDepartureFilterByPredictedArrivalTime extends ArrivalAndDepartureFilter{ + + @Override + public boolean matches(ArrivalAndDepartureBean bean) { + if(!( bean.getPredictedArrivalTime() > 0 && bean.getPredictedArrivalTime() < System.currentTimeMillis())){ + return true; + } + return false; + } + +}