Ejemplo n.º 1
0
 /**
  * удалить клиента по имени
  *
  * @param name имя клиента
  */
 public void removeClientByName(final String name) {
   int j = 0;
   for (Iterator<Client> it = clients.iterator(); it.hasNext(); ) {
     if (it.next().getId().equals(name)) {
       it.remove();
       j = j + 1;
     }
   }
   if (j != 0) {
     System.out.println("The client " + name + " has removed successfully");
   } else {
     System.out.println("That client doesn't exist in the base");
   }
 }
Ejemplo n.º 2
0
 public java.util.Iterator<Integer> iterator() {
   return list.iterator();
 }