Total Complexity | 18 |
Total Lines | 82 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class Node |
||
6 | { |
||
7 | private $content; |
||
8 | private $top; |
||
9 | private $right; |
||
10 | private $left; |
||
11 | private $bottom; |
||
12 | |||
13 | public function getContent() |
||
14 | { |
||
15 | return $this->content; |
||
16 | } |
||
17 | |||
18 | public function setContent($content) |
||
19 | { |
||
20 | $this->content = $content; |
||
21 | |||
22 | return $this; |
||
23 | } |
||
24 | |||
25 | public function getTop() |
||
26 | { |
||
27 | return $this->top; |
||
28 | } |
||
29 | |||
30 | public function setTop(Node $top = null) |
||
31 | { |
||
32 | $this->top = $top; |
||
33 | |||
34 | if (null !== $top && $this !== $top->getBottom()) { |
||
35 | $top->setBottom($this); |
||
36 | } |
||
37 | |||
38 | return $this; |
||
39 | } |
||
40 | |||
41 | public function getBottom() |
||
42 | { |
||
43 | return $this->bottom; |
||
44 | } |
||
45 | |||
46 | public function setBottom(Node $bottom = null) |
||
47 | { |
||
48 | $this->bottom = $bottom; |
||
49 | |||
50 | if (null !== $bottom && $this !== $bottom->getTop()) { |
||
51 | $bottom->setTop($this); |
||
52 | } |
||
53 | |||
54 | return $this; |
||
55 | } |
||
56 | |||
57 | public function getLeft() |
||
60 | } |
||
61 | |||
62 | public function setLeft(Node $left = null) |
||
63 | { |
||
64 | $this->left = $left; |
||
65 | |||
66 | if (null !== $left && $this !== $left->getRight()) { |
||
67 | $left->setRight($this); |
||
68 | } |
||
69 | |||
70 | return $this; |
||
71 | } |
||
72 | |||
73 | public function getRight() |
||
74 | { |
||
75 | return $this->right; |
||
76 | } |
||
77 | |||
78 | public function setRight(Node $right = null) |
||
87 | } |
||
88 | } |
||
89 |