Ejemplo n.º 1
0
 @Override
 public List<Route> getRoute(String busNumber, String machine) {
   List<Route> list = new ArrayList<>();
   for (BusInfo busInfo : DataManager.getInstance().getBusInfo()) {
     if (busInfo.getBusNumber().equals(busNumber) && busInfo.getMachine().equals(machine)) {
       List<Route> routes = DataManager.getInstance().getRoutes();
       for (Route route : routes) {
         if (route.getBus_info_id() == busInfo.getId()) list.add(route);
       }
       break;
     }
   }
   return list;
 }
Ejemplo n.º 2
0
 @Override
 public BusInfo getBusInfo(String busNumber, String machine) {
   for (BusInfo busInfo : DataManager.getInstance().getBusInfo()) {
     if (busInfo.getBusNumber().equals(busNumber) && busInfo.getMachine().equals(machine))
       return busInfo;
   }
   return null;
 }