Beispiel #1
0
 private int logContains(int xId) {
   synchronized (logArray) {
     for (int i = 0; i < logArray.size(); i++) {
       Log temp = (Log) logArray.elementAt(i);
       if (temp.getXId() == xId) {
         return i;
       }
     }
   }
   return -1;
 }
Beispiel #2
0
  /* reserve an itinerary */
  public boolean itinerary(
      int id, int customer, Vector flightNumbers, String location, boolean Car, boolean Room)
      throws RemoteException {
    int noFlight = flightNumbers.size();
    boolean result = false;
    ;
    for (int i = 0; i < noFlight; i++) {
      result = reserveFlight(id, customer, Integer.parseInt(flightNumbers.get(i).toString()));
      if (!result) break;
    }

    return result;
  }