3 namespace Org\Mxchange\CoreFramework\Stack\!!!;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Stack\BaseStacker;
7 use Org\Mxchange\CoreFramework\Stack\Stackable;
12 * @author Roland Haeder <webmaster@ship-simu.org>
14 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
15 * @license GNU GPL 3.0 or any newer version
16 * @link http://www.ship-simu.org
18 * This program is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation, either version 3 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
31 class ???Stacker extends BaseStacker implements Stackable {
33 * Protected constructor
37 private function __construct () {
38 // Call parent constructor
39 parent::__construct(__CLASS__);
43 * Creates an instance of the class Stacker and prepares it for usage
45 * @param $appInstance A manageable application
46 * @return $stackInstance An instance of ???Stacker
48 public final static function create???Stacker (ManageableApplication $appInstance) {
50 $stackInstance = new ???Stacker();
52 // Init generic stacker
53 $stackInstance->initStack('generic');
55 // Return the prepared instance
56 return $stackInstance;
60 * Pushs a value on a named stacker
62 * @param $stackerName Name of the stack
63 * @param $value Value to push on it
65 * @throws StackerFullException If the stack is full
67 public function pushNamed ($stackerName, $value) {
68 $this->partialStub('stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . $value);
72 * 'Pops' a value from a named stacker
74 * @param $stackerName Name of the stack
76 * @throws NoStackerException If the named stacker was not found
77 * @throws EmptyStackerException If the named stacker is empty
79 public function popNamed ($stackerName) {
80 $this->partialStub('stackerName=' . $stackerName);
84 * Get value from named stacker
86 * @param $stackerName Name of the stack
87 * @return $value Value of last added value
88 * @throws NoStackerException If the named stacker was not found
89 * @throws EmptyStackerException If the named stacker is empty
91 public function getNamed ($stackerName) {
92 $this->partialStub('stackerName=' . $stackerName);