-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVertice.java
59 lines (46 loc) · 984 Bytes
/
Vertice.java
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
48
49
50
51
52
53
54
55
56
57
58
59
package Exercicio2;
import java.util.LinkedList;
public class Vertice {
private int nome;
private int cor;
private int distancia;
private Vertice parente;
private LinkedList<Vertice> adjacente;
public Vertice(int nome) {
setNome(nome);
setCor(0);
setDistancia(-1);
setParente(null);
setAdjacente(new LinkedList<>());
}
protected int getNome() {
return nome;
}
protected void setNome(int nome) {
this.nome = nome;
}
protected int getCor() {
return cor;
}
protected void setCor(int cor) {
this.cor = cor;
}
protected int getDistancia() {
return distancia;
}
protected void setDistancia(int distancia) {
this.distancia = distancia;
}
protected Vertice getParente() {
return parente;
}
protected void setParente(Vertice parente) {
this.parente = parente;
}
protected LinkedList<Vertice> getAdjacente() {
return adjacente;
}
protected void setAdjacente(LinkedList<Vertice> adjacente) {
this.adjacente = adjacente;
}
}