Continued:
[core.git] / framework / main / interfaces / stacker / class_Stackable.php
index b1e783979c2179e3d0199debaa57a3682b76d7da..4881c6f6d9565641d2ba15be6e2f9d317ecae34f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Mxchange\CoreFramework\Stacker;
+namespace Org\Mxchange\CoreFramework\Stack;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -34,29 +34,29 @@ interface Stackable extends FrameworkInterface {
         * @param       $stackerName    Name of the stacker
         * @param       $value                  Value to push on it
         * @return      void
-        * @throws      StackerFullException    If the stacker is full
+        * @throws      BadMethodCallException  If the stacker is full
         */
-       function pushNamed ($stackerName, $value);
+       function pushNamed (string $stackerName, $value);
 
        /**
         * 'Pops' a value from a named stacker and returns it's value
         *
         * @param       $stackerName    Name of the stacker
         * @return      $value                  Value of the current stack entry
-        * @throws      NoStackerException      If the named stacker was not found
-        * @throws      EmptyStackerException   If the named stacker is empty
+        * @throws      BadMethodCallException  If the named stacker was not found
+        * @throws      BadMethodCallException  If the named stacker is empty
         */
-       function popNamed ($stackerName);
+       function popNamed (string $stackerName);
 
        /**
         * Get value from named stacker but don't "pop" it
         *
         * @param       $stackerName    Name of the stacker
         * @return      $value                  Value of last added value
-        * @throws      NoStackerException      If the named stacker was not found
-        * @throws      EmptyStackerException   If the named stacker is empty
+        * @throws      BadMethodCallException  If the named stacker was not found
+        * @throws      BadMethodCallException  If the named stacker is empty
         */
-       function getNamed ($stackerName);
+       function getNamed (string $stackerName);
 
        /**
         * Checks whether the given stack is initialized (set in array $stackers)
@@ -64,15 +64,41 @@ interface Stackable extends FrameworkInterface {
         * @param       $stackerName    Name of the stack
         * @return      $isInitialized  Whether the stack is initialized
         */
-       function isStackInitialized ($stackerName);
+       function isStackInitialized (string $stackerName);
 
        /**
         * Checks whether the given stack is empty
         *
         * @param       $stackerName    Name of the stack
         * @return      $isEmpty                        Whether the stack is empty
-        * @throws      NoStackerException      If given stack is missing
+        * @throws      BadMethodCallException  If given stack is missing
         */
-       function isStackEmpty ($stackerName);
+       function isStackEmpty (string $stackerName);
+
+       /**
+        * Initializes given stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @param       $forceReInit    Force re-initialization
+        * @return      void
+        * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
+        */
+       function initStack (string $stackerName, bool $forceReInit = false);
+
+       /**
+        * Initializes all stacks
+        *
+        * @return      void
+        * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
+        */
+       function initStacks (array $stacks, bool $forceReInit = false);
+
+       /**
+        * Getter for size of given stack (array count)
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $count                  Size of stack (array count)
+        */
+       function getStackCount (string $stackerName);
 
 }