import java.util.LinkedList; import java.util.Queue; public class Stand_de_cuisson { private Queue clients = new LinkedList(); //get le client en tĂȘte de queue public synchronized Client getClient(){ return clients.peek(); } //supprime le client en tĂȘte de queue public synchronized void nextClient(){ clients.poll(); } public synchronized void finir_cuit(){ notifyAll(); } public synchronized void ajouter_client(Client client){ clients.add(client); notifyAll(); } public synchronized boolean containsClient(Client client){ return this.clients.contains(client); } }