summaryrefslogtreecommitdiff
path: root/sem_5/HLIN505_Java/HLIN505/src/TP1/Creneau.java
blob: 2bec4207ecd9fd9fc6fb1e16402aa2033f564e89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package TP1;

public class Creneau {
	private Heure hdeb;
	private Heure hfin;
	private JourSemaine jour;
	
	protected Heure getHdeb() {
		return hdeb;
	}
	protected void setHdeb(Heure hdeb) {
		this.hdeb = hdeb;
	}
	protected Heure getHfin() {
		return hfin;
	}
	protected void setHfin(Heure hfin) {
		this.hfin = hfin;
	}
	protected JourSemaine getJour() {
		return jour;
	}
	protected void setJour(JourSemaine jour) {
		this.jour = jour;
	}
	public Creneau ( Heure deb, Heure fin, JourSemaine j) {
		setHdeb(deb);
		setHfin(fin);
		setJour(j);
	}
	public Boolean chevauche(Creneau c) {
		return (getHdeb().estAvant(c.getHfin())||c.getHdeb().estAvant(getHfin()));
	}
	public Boolean estInclusDans(Creneau c) {
		return ((c.getHdeb().estAvant(getHdeb()) && (getHfin().estAvant(c.getHfin()))));
	}
	public String toString() {
		return getJour().toString()+" "+ getHdeb().toString()+" - "+ getHfin().toString();
	}
}