]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/stacker/class_BaseStacker.php
Made lower to upper case:
[core.git] / inc / classes / main / stacker / class_BaseStacker.php
index b186e064f977101e81b61bd307b57719f9706ea3..147ae9d88086189643d25823baf963368ac94613 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -48,12 +48,13 @@ class BaseStacker extends BaseFrameworkSystem {
         * Initializes given stacker
         *
         * @param       $stackerName    Name of the stack
+        * @param       $forceReInit    Force re-initialization
         * @return      void
         * @throws      AlreadyInitializedStackerException      If the stack is already initialized
         */
-       public 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
@@ -66,10 +67,10 @@ class BaseStacker extends BaseFrameworkSystem {
        }
 
        /**
-        * Checks wether the given stack is initialized (set in array $stackers)
+        * Checks whether the given stack is initialized (set in array $stackers)
         *
         * @param       $stackerName    Name of the stack
-        * @return      $isInitialized  Wether the stack is initialized
+        * @return      $isInitialized  Whether the stack is initialized
         */
        public final function isStackInitialized ($stackerName) {
                // Is is there?
@@ -80,10 +81,10 @@ class BaseStacker extends BaseFrameworkSystem {
        }
 
        /**
-        * Checks wether the given stack is full
+        * Checks whether the given stack is full
         *
         * @param       $stackerName    Name of the stack
-        * @return      $isFull                 Wether the stack is full
+        * @return      $isFull                 Whether the stack is full
         * @throws      NoStackerException      If given stack is missing
         */
        protected final function isStackFull ($stackerName) {
@@ -101,10 +102,10 @@ class BaseStacker extends BaseFrameworkSystem {
        }
 
        /**
-        * Checks wether the given stack is empty
+        * Checks whether the given stack is empty
         *
-        * @param       $stackerName    Name of the stack
-        * @return      $isEmpty                        Wether the stack is empty
+        * @param       $stackerName            Name of the stack
+        * @return      $isEmpty                        Whether the stack is empty
         * @throws      NoStackerException      If given stack is missing
         */
        public final function isStackEmpty ($stackerName) {
@@ -114,11 +115,11 @@ class BaseStacker extends BaseFrameworkSystem {
                        throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
                } // END - if
 
-               // So, is the stack full?
-               $isFull = (($this->getStackCount($stackerName)) == 0);
+               // So, is the stack empty?
+               $isEmpty = (($this->getStackCount($stackerName)) == 0);
 
                // Return result
-               return $isFull;
+               return $isEmpty;
        }
 
        /**
@@ -128,7 +129,7 @@ class BaseStacker extends BaseFrameworkSystem {
         * @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