ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilDclStack.php
Go to the documentation of this file.
1
<?
php
2
9
class
ilDclStack
10
{
11
15
protected
$stack
= array();
16
17
21
public
function
push
($elem)
22
{
23
$this->stack[] = $elem;
24
}
25
26
30
public
function
pop
()
31
{
32
if
(!$this->
isEmpty
()) {
33
$last_index =
count
($this->stack) - 1;
34
$elem = $this->stack[$last_index];
35
unset($this->stack[$last_index]);
36
$this->stack = array_values($this->stack);
// re-index
37
38
return
$elem;
39
}
40
41
return
null;
42
}
43
44
48
public
function
top
()
49
{
50
if
(!$this->
isEmpty
()) {
51
return
$this->stack[
count
($this->stack) - 1];
52
}
53
54
return
null;
55
}
56
57
61
public
function
isEmpty
()
62
{
63
return
!(bool)
count
($this->stack);
64
}
65
66
67
public
function
reset
()
68
{
69
$this->stack = array();
70
}
71
72
76
public
function
count
()
77
{
78
return
count
($this->stack);
79
}
80
81
82
public
function
debug
()
83
{
84
echo
"<pre>"
. print_r($this->stack, 1) .
"</pre>"
;
85
}
86
}
ilDclStack\count
count()
Definition:
class.ilDclStack.php:76
ilDclStack\push
push($elem)
Definition:
class.ilDclStack.php:21
ilDclStack\reset
reset()
Definition:
class.ilDclStack.php:67
ilDclStack
Class ilDclStack.
Definition:
class.ilDclStack.php:9
ilDclStack\isEmpty
isEmpty()
Definition:
class.ilDclStack.php:61
ilDclStack\top
top()
Definition:
class.ilDclStack.php:48
echo
ilDclStack\debug
debug()
Definition:
class.ilDclStack.php:82
ilDclStack\pop
pop()
Definition:
class.ilDclStack.php:30
php
ilDclStack\$stack
$stack
Definition:
class.ilDclStack.php:15
Modules
DataCollection
classes
Fields
Formula
class.ilDclStack.php
Generated on Thu Jan 16 2025 19:02:02 for ILIAS by
1.8.13 (using
Doxyfile
)