* Initializes given stacker
*
* @param $stackerName Name of the stack
+ * @param $forceReInit Force re-initialization
* @return void
* @throws AlreadyInitializedStackerException If the stack is already initialized
*/
- protected final function initStacker ($stackerName) {
+ public final function initStacker ($stackerName, $forceReInit = false) {
// Is the stack already initialized?
- if ($this->isStackInitialized($stackerName)) {
+ if (($forceReInit === false) && ($this->isStackInitialized($stackerName))) {
// Then throw the exception
throw new AlreadyInitializedStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_ALREADY_INITIALIZED);
} // END - if
throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
} // END - if
- // So, is the stack full?
+ // So, is the stack empty?
$isFull = (($this->getStackCount($stackerName)) == 0);
// Return result
* @return $count Size of stack (array count)
* @throws NoStackerException If given stack is missing
*/
- protected final function getStackCount ($stackerName) {
+ public final function getStackCount ($stackerName) {
// Is the stack not yet initialized?
if (!$this->isStackInitialized($stackerName)) {
// Throw an exception