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 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
14 * @license GNU GPL 3.0 or any newer version
15 * @link http://www.shipsimu.org
17 * This program is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program. If not, see <http://www.gnu.org/licenses/>.
30 interface Stackable extends FrameworkInterface {
32 * Pushs a value on a named stacker
34 * @param $stackerName Name of the stacker
35 * @param $value Value to push on it
37 * @throws StackerFullException If the stacker is full
39 function pushNamed ($stackerName, $value);
42 * 'Pops' a value from a named stacker and returns it's value
44 * @param $stackerName Name of the stacker
45 * @return $value Value of the current stack entry
46 * @throws NoStackerException If the named stacker was not found
47 * @throws EmptyStackerException If the named stacker is empty
49 function popNamed ($stackerName);
52 * Get value from named stacker but don't "pop" it
54 * @param $stackerName Name of the stacker
55 * @return $value Value of last added value
56 * @throws NoStackerException If the named stacker was not found
57 * @throws EmptyStackerException If the named stacker is empty
59 function getNamed ($stackerName);
62 * Checks whether the given stack is initialized (set in array $stackers)
64 * @param $stackerName Name of the stack
65 * @return $isInitialized Whether the stack is initialized
67 function isStackInitialized ($stackerName);
70 * Checks whether the given stack is empty
72 * @param $stackerName Name of the stack
73 * @return $isEmpty Whether the stack is empty
74 * @throws NoStackerException If given stack is missing
76 function isStackEmpty ($stackerName);