-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTacheDecomposable.java
More file actions
44 lines (32 loc) · 1.35 KB
/
TacheDecomposable.java
File metadata and controls
44 lines (32 loc) · 1.35 KB
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
41
42
43
44
import java.time.Duration;
import java.time.LocalDate;
public class TacheDecomposable extends Tache implements Decomposable{
private int numeroSousTache;
public TacheDecomposable(String nom, Duration durée, Priorite priorite, LocalDate dateLimite, Categorie categorie, Etat etat,int numeroSousTache) {
super(nom, durée, priorite, dateLimite, categorie, etat);
this.numeroSousTache = numeroSousTache;
}
// Constructeur qui permets de générer une tache décomposable avec un numéro de sous tache par défaut à 1 et UNSCHEDULED
public TacheDecomposable(String nom, Duration durée, Priorite priorite, LocalDate dateLimite, Categorie categorie) {
super(nom, durée, priorite, dateLimite, categorie,Etat.UNSCHEDULED);
this.numeroSousTache = 1;
}
// --------------- Getters/Setters ---------------
public int getNumeroSousTache() {
return numeroSousTache;
}
public void setNumeroSousTache(int numeroSousTache) {
this.numeroSousTache = numeroSousTache;
}
// --------------- Getters/Setters ---------------
@Override
boolean isDecomposable() {
return true;
}
public int incNumeroSousTache(){
return numeroSousTache+1;
}
public void decomposer() {
this.setNom(this.getNom() + Integer.toString(getNumeroSousTache()));
}
}