-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSommet.java
More file actions
47 lines (35 loc) · 934 Bytes
/
Sommet.java
File metadata and controls
47 lines (35 loc) · 934 Bytes
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
45
46
47
package Structure;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;
import java.util.Map;
import java.util.HashMap;
//Un sommet poss�de un nom et une couleur.
//On peut :
//- Cr�er un sommet
//- Lui ajouter des ar�tes incidentes
//- Obtenir sa composante connexe
//- Lui donner une couleur
//Ici, les sommets repr�sentent aussi des composantes connexes, on
//peut donc encore :
//- Unir la composante d'un sommet avec celle d'un autre sommet
class Sommet {
private int nom;
// Je croyais que j'avais besoin de cet attribut mais � l'heure
// actuelle il n'est pas utilis�...
private Graphe graphe;
public Sommet(Graphe g, int n) {
graphe = g;
nom = n;
}
public int getNom() {
return nom;
}
public void setNom(int nom) {
this.nom = nom;
}
@Override
public String toString() {
return "Sommet [nom=" + this.getNom() + "]";
}
}