/** * 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); }
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; }
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++; } }
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--; } }