ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
EvalMathStack Class Reference
+ Collaboration diagram for EvalMathStack:

Public Member Functions

 push ($val)
 
 pop ()
 
 last ($n=1)
 

Data Fields

 $stack = array()
 
 $count = 0
 

Detailed Description

Definition at line 442 of file class.EvalMath.php.

Member Function Documentation

◆ last()

EvalMathStack::last (   $n = 1)

Definition at line 462 of file class.EvalMath.php.

463 {
464 // mjansen-patch: begin
465 if (isset($this->stack[$this->count - $n])) {
466 return $this->stack[$this->count - $n];
467 }
468 return null;
469 // mjansen-patch: end
470 }
$n
Definition: RandomTest.php:85

References $n.

◆ pop()

EvalMathStack::pop ( )

Definition at line 453 of file class.EvalMath.php.

454 {
455 if ($this->count > 0) {
456 $this->count--;
457 return $this->stack[$this->count];
458 }
459 return null;
460 }

References $count.

◆ push()

EvalMathStack::push (   $val)

Definition at line 447 of file class.EvalMath.php.

448 {
449 $this->stack[$this->count] = $val;
450 $this->count++;
451 }

References $count.

Field Documentation

◆ $count

EvalMathStack::$count = 0

Definition at line 445 of file class.EvalMath.php.

Referenced by pop(), and push().

◆ $stack

EvalMathStack::$stack = array()

Definition at line 444 of file class.EvalMath.php.


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