Search in sources :

Example 1 with TimeWindowFilter

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;
}
Also used : TimeWindowFilter(org.onebusaway.admin.search.impl.TimeWindowFilter) ArrayList(java.util.ArrayList) VehicleStatus(org.onebusaway.admin.model.ui.VehicleStatus)

Aggregations

ArrayList (java.util.ArrayList)1 VehicleStatus (org.onebusaway.admin.model.ui.VehicleStatus)1 TimeWindowFilter (org.onebusaway.admin.search.impl.TimeWindowFilter)1