3 namespace Org\Mxchange\CoreFramework\Lists;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
7 use Org\Mxchange\CoreFramework\Visitor\Visitable;
10 use \IteratorAggregate;
13 * An interface for lists
15 * @author Roland Haeder <webmaster@shipsimu.org>
17 <<<<<<< HEAD:framework/main/interfaces/lists/class_Listable.php
18 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
20 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
21 >>>>>>> Some updates::inc/main/interfaces/lists/class_Listable.php
22 * @license GNU GPL 3.0 or any newer version
23 * @link http://www.shipsimu.org
25 * This program is free software: you can redistribute it and/or modify
26 * it under the terms of the GNU General Public License as published by
27 * the Free Software Foundation, either version 3 of the License, or
28 * (at your option) any later version.
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
35 * You should have received a copy of the GNU General Public License
36 * along with this program. If not, see <http://www.gnu.org/licenses/>.
38 interface Listable extends FrameworkInterface, IteratorAggregate {
40 * Checks whether the given group is set
42 * @param $groupName Group to check if found in list
43 * @return $isset Whether the group is valid
45 function isGroupSet ($groupName);
48 * Adds the given group or if already added issues a ListGroupAlreadyAddedException
50 * @param $groupName Group to add
52 * @throws ListGroupAlreadyAddedException If the given group is already added
54 function addGroup ($groupName);
57 * Adds the given instance to list group and sub group
59 * @param $groupName Group to add instance to
60 * @param $subGroup Sub group to add instance to
61 * @param $visitableInstance An instance of Visitable
63 * @throws NoListGroupException If the given group is not found
65 function addInstance ($groupName, $subGroup, Visitable $visitableInstance);
68 * Adds the given entry to list group
70 * @param $groupName Group to add instance to
71 * @param $entry An entry of any type
73 * @throws NoListGroupException If the given group is not found
75 function addEntry ($groupName, $entry);
78 * Updates the given entry by hash with given array
80 * @param $hash Hash for this entry
81 * @param $entryArray Array with entry we should update
83 * @throws InvalidListHashException If the solved hash index is invalid
85 function updateCurrentEntryByHash ($hash, array $entryArray);
88 * "Getter" for an iterator instance of this list
90 * @return $iteratorInstance An instance of a Iterator class
92 function getListIterator ();
95 * Clears this list (mostly by clearing all groups together)
99 function clearList ();
102 * Setter for call-back instance
104 * @param $callbackInstance An instance of a FrameworkInterface class
107 function setCallbackInstance (FrameworkInterface $callbackInstance);