-
Notifications
You must be signed in to change notification settings - Fork 0
/
Noeud.java
97 lines (77 loc) · 1.44 KB
/
Noeud.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
public class Noeud{
//---------------------------------------
// attributs
//---------------------------------------
private Sequence cle;
private char[][] ali;
private Noeud fg;
private Noeud fd;
//---------------------------------------
// constructeurs
//---------------------------------------
public Noeud(Noeud fg, Noeud fd)
{
this.cle = null;
this.fg = fg;
this.fd = fd;
}
public Noeud(Sequence cle)
{
this.cle = cle;
this.fg = null;
this.fd = null;
}
//---------------------------------------
// méthodes
//---------------------------------------
//Accesseurs
public Sequence getCle()
{
return cle;
}
public Noeud getfg()
{
return fg;
}
public Noeud getfd()
{
return fd;
}
public char[][] getAli()
{
return ali;
}
//setteurs
public void setAli(char[][] alignement_voulu)
{
this.ali = alignement_voulu;
}
public void setCle(Sequence seq_ou_cons)
{
this.cle = seq_ou_cons;
}
//affichage
public void afficheNoeud()
{
System.out.println("noeud\ncle : " + cle + "\nfg : " + fg + "\nfd : " + fd);
}
public void afficheAliNoeud()
{
int i, j, lin, col;
System.out.print("affiche Alignement du Noeud\n");
lin = ali.length;
col = ali[0].length;
for(i = 0; i < lin; i++)
{
for(j = 0; j< col; j++)
{
System.out.print(this.ali[i][j]);
}
System.out.print("\n");
}
}
public void afficheCle()
{
System.out.print(cle.getSeq() + "\n");
}
}