ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDclStack Class Reference

Class ilDclStack. More...

+ Collaboration diagram for ilDclStack:

Public Member Functions

 push ($elem)
 pop ()
 top ()
 isEmpty ()
 reset ()
 count ()
 debug ()

Protected Attributes

 $stack = array()

Detailed Description

Member Function Documentation

ilDclStack::count ( )
Returns
int

Definition at line 69 of file class.ilDclStack.php.

Referenced by isEmpty(), pop(), and top().

{
return count($this->stack);
}

+ Here is the caller graph for this function:

ilDclStack::debug ( )

Definition at line 74 of file class.ilDclStack.php.

{
echo "<pre>" . print_r($this->stack, 1) . "</pre>";
}
ilDclStack::isEmpty ( )
Returns
bool

Definition at line 56 of file class.ilDclStack.php.

References count().

Referenced by pop(), and top().

{
return !(bool)count($this->stack);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDclStack::pop ( )
Returns
null

Definition at line 28 of file class.ilDclStack.php.

References count(), and isEmpty().

{
if (!$this->isEmpty()) {
$last_index = count($this->stack) - 1;
$elem = $this->stack[$last_index];
unset($this->stack[$last_index]);
$this->stack = array_values($this->stack); // re-index
return $elem;
}
return NULL;
}

+ Here is the call graph for this function:

ilDclStack::push (   $elem)
Parameters
$elem

Definition at line 20 of file class.ilDclStack.php.

{
$this->stack[] = $elem;
}
ilDclStack::reset ( )

Definition at line 61 of file class.ilDclStack.php.

{
$this->stack = array();
}
ilDclStack::top ( )
Returns
null

Definition at line 44 of file class.ilDclStack.php.

References count(), and isEmpty().

{
if (!$this->isEmpty()) {
return $this->stack[count($this->stack) - 1];
}
return NULL;
}

+ Here is the call graph for this function:

Field Documentation

ilDclStack::$stack = array()
protected

Definition at line 14 of file class.ilDclStack.php.


The documentation for this class was generated from the following file: