01: package hero.xpdl;
02:
03: import org.w3c.dom.*;
04:
05: public class BonitaTree {
06: public Node Noeud;
07: public int NbFils;
08:
09: public BonitaTree Fils[];
10:
11: // First Constructor
12: public BonitaTree(Node N) {
13:
14: this .Noeud = N;
15: NodeList Fistons = N.getChildNodes();
16: this .NbFils = Fistons.getLength();
17: Fils = new BonitaTree[NbFils];
18: for (int i = 0; i < Fistons.getLength(); i++)
19: Fils[i] = new BonitaTree(Fistons.item(i));
20: }
21:
22: public boolean isLeaf() {
23: return NbFils == 0;
24: }
25:
26: public void InitTree(Node N, int Nb) {
27: this.Noeud = N;
28: this.NbFils = Nb;
29: }
30: }
|