Esempio n. 1
0
 /**
  * найти клиентов по имени животного
  *
  * @param name имя животного
  */
 public SimpleLinkedList<Client> findClientsByPetName(final String name) {
   SimpleLinkedList<Client> foundedClients = new SimpleLinkedList<Client>();
   int i = 0;
   for (Client client : clients) {
     if (client != null && client.getPet().getName().equals(name)) {
       foundedClients.addLast(client);
       i++;
     }
   }
   return foundedClients;
 }
Esempio n. 2
0
 /**
  * найти животных по имени клиента
  *
  * @param client имя клиента
  */
 public SimpleLinkedList<Pet> findPetsByClient(final String client) {
   SimpleLinkedList<Pet> foundedPets = new SimpleLinkedList<Pet>();
   int i = 0;
   for (Client clientId : clients) {
     if (clientId != null && clientId.getId().equals(client)) {
       foundedPets.addLast(clientId.getPet());
       i++;
     }
   }
   return foundedPets;
 }
Esempio n. 3
0
 /** печать всех клиентов клиники и их домашних животных */
 public void printAllClients() {
   for (Client client : clients) {
     System.out.println(client.getId() + " - " + client.getPet().getName());
   }
 }