package TP1; import java.util.*; public enum Lieu { Stade("Stade de foot"), Gymnase("Gymnase"), Piscine("La piscine"); private ArrayList horairedispo = new ArrayList(); private String nom = ""; private Lieu(String nom){ this.nom = nom; } public String toString() { String tmp = this.nom+"\n"; for (Creneau c:horairedispo) tmp += c.toString()+"\n"; return tmp; } public void ajoutCreneauDisponible(Creneau c) { horairedispo.add(c); } public Boolean estdisponiblePour(Creneau c) { return horairedispo.contains(c); } }