use of org.onebusaway.admin.search.impl.TimeWindowFilter in project onebusaway-application-modules by camsys.
the class VehicleSearchServiceImpl method searchVehiclesTracked.
@Override
public List<VehicleStatus> searchVehiclesTracked(int minutes, List<VehicleStatus> vehicleStatusRecords) {
Filter<VehicleStatus> timeWindowFilter = new TimeWindowFilter(minutes);
List<VehicleStatus> vehiclesTracked = new ArrayList<VehicleStatus>();
for (VehicleStatus vehicleStatus : vehicleStatusRecords) {
if (timeWindowFilter.apply(vehicleStatus)) {
vehiclesTracked.add(vehicleStatus);
}
}
return vehiclesTracked;
}
Aggregations