예제 #1
0
 /**
  * Since there are no interface to put a sectionList, this method should be used to know existing
  * sections
  *
  * @return list of existing sections
  */
 public List<String> listExistingSections() {
   Set<String> returnSet = new HashSet<String>();
   for (Ticket t : ticketList) {
     returnSet.add(t.getSection());
   }
   return new ArrayList<String>(returnSet);
 }
예제 #2
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;
 }
예제 #3
0
 public void addTicketToList(Ticket _ticket) {
   ticketList.add(_ticket);
   this.ticketsTotal++;
   // si le owner est vide cela signifie un billet disponible
   if (_ticket.getOwner().equals("")) {
     this.ticketsAvailable++;
   } else if (_ticket.getResellprice() != 0) {
     this.ticketsAvailable++;
   }
 }
예제 #4
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--;
   }
 }