Exemple #1
0
 public boolean findAndEditTicket(Ticket _ticket) {
   for (Iterator<Ticket> it = this.ticketList.iterator(); it.hasNext(); ) {
     Ticket old = it.next();
     if (old.getId() == _ticket.getId()) {
       old.changeValuesFromTicketObject(_ticket);
       return true;
     }
   }
   return false;
 }
Exemple #2
0
 public void removeTicketFromList(UUID _ticketId) {
   Ticket ticket = null;
   for (Iterator<Ticket> it = this.ticketList.iterator(); it.hasNext(); ) {
     Ticket itTicket = it.next();
     if (itTicket.getId().equals(_ticketId)) {
       ticket = itTicket;
     }
   }
   if (ticket != null) {
     ticketList.remove(ticket);
     this.ticketsTotal--;
     this.ticketsAvailable--;
   }
 }