3 namespace Org\Mxchange\CoreFramework\Stacker;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
9 * A Stackable interface
11 * @author Roland Haeder <webmaster@shipsimu.org>
13 <<<<<<< HEAD:framework/main/interfaces/stacker/class_Stackable.php
14 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
16 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
17 >>>>>>> Some updates::inc/main/interfaces/stacker/class_Stackable.php
18 * @license GNU GPL 3.0 or any newer version
19 * @link http://www.shipsimu.org
21 * This program is free software: you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation, either version 3 of the License, or
24 * (at your option) any later version.
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with this program. If not, see <http://www.gnu.org/licenses/>.
34 interface Stackable extends FrameworkInterface {
36 * Pushs a value on a named stacker
38 * @param $stackerName Name of the stacker
39 * @param $value Value to push on it
41 * @throws StackerFullException If the stacker is full
43 function pushNamed ($stackerName, $value);
46 * 'Pops' a value from a named stacker and returns it's value
48 * @param $stackerName Name of the stacker
49 * @return $value Value of the current stack entry
50 * @throws NoStackerException If the named stacker was not found
51 * @throws EmptyStackerException If the named stacker is empty
53 function popNamed ($stackerName);
56 * Get value from named stacker but don't "pop" it
58 * @param $stackerName Name of the stacker
59 * @return $value Value of last added value
60 * @throws NoStackerException If the named stacker was not found
61 * @throws EmptyStackerException If the named stacker is empty
63 function getNamed ($stackerName);
66 * Checks whether the given stack is initialized (set in array $stackers)
68 * @param $stackerName Name of the stack
69 * @return $isInitialized Whether the stack is initialized
71 function isStackInitialized ($stackerName);
74 * Checks whether the given stack is empty
76 * @param $stackerName Name of the stack
77 * @return $isEmpty Whether the stack is empty
78 * @throws NoStackerException If given stack is missing
80 function isStackEmpty ($stackerName);