MIOLO20
Toggle main menu visibility
Página principal
Estruturas de dados
Estruturas de dados
Hierarquia de classes
Campos de dados
Tudo
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Funções
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variáveis
$
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Ficheiros
Lista de ficheiros
Globais
Tudo
$
_
a
c
d
e
f
g
i
l
m
o
p
r
s
u
Funções
Variáveis
$
_
c
e
f
l
m
o
p
s
Exemplos
•
Tudo
Estruturas de dados
Namespaces
Ficheiros
Funções
Variáveis
Carregando...
Procurando...
Nenhuma entrada encontrada
mtree.class
Ir para a documentação deste ficheiro.
1
<?php
2
// +-----------------------------------------------------------------+
3
// | MIOLO - Miolo Development Team - UNIVATES Centro Universitário |
4
// +-----------------------------------------------------------------+
5
// | CopyLeft (L) 2001-2002 UNIVATES, Lajeado/RS - Brasil |
6
// +-----------------------------------------------------------------+
7
// | Licensed under GPL: see COPYING.TXT or FSF at www.fsf.org for |
8
// | further details |
9
// | |
10
// | Site: http://miolo.codigolivre.org.br |
11
// | E-mail: vgartner@univates.br |
12
// | ts@interact2000.com.br |
13
// +-----------------------------------------------------------------+
14
// | Abstract: |
15
// | |
16
// | Created: 2001/08/14 Thomas Spriestersbach |
17
// | Vilson Cristiano Gärtner, |
18
// | |
19
// | History: Initial Revision |
20
// +-----------------------------------------------------------------+
21
26
class
MTree
27
{
31
var
$root
;
// an array of arrays of tree nodes
32
43
function
__construct
()
44
{
45
}
43
function
__construct
() {
…
}
46
61
function
AddItem
(
$id
, $parent, $data)
62
{
63
if
(!$parent)
64
$parent =
$this->root
;
65
66
$node =
FindNode
($this->root, $parent);
67
}
61
function
AddItem
(
$id
, $parent, $data) {
…
}
68
72
function
&
FindNode
($parent,
$id
)
73
{
74
if
(!$parent)
75
return
null
;
76
77
foreach
($parent as $key => $data)
78
{
79
if
($key ==
$id
)
80
return
$data;
81
82
$node = $this->
FindNode
($data);
83
84
if
($node)
85
return
$node;
86
}
87
88
return
null
;
89
}
72
function
&
FindNode
($parent,
$id
) {
…
}
90
101
function
Generate
()
102
{
103
}
101
function
Generate
() {
…
}
104
}
26
class
MTree
{
…
};
105
?>
MTree
Definição
mtree.class:27
MTree\__construct
__construct()
Definição
mtree.class:43
MTree\Generate
Generate()
Definição
mtree.class:101
MTree\$root
$root
Definição
mtree.class:31
MTree\FindNode
& FindNode($parent, $id)
Definição
mtree.class:72
MTree\AddItem
AddItem($id, $parent, $data)
Definição
mtree.class:61
$id
$id
Definição
base.php:5
classes
utils
mtree.class
Gerado por
1.10.0