]> git.mxchange.org Git - core.git/blob - framework/main/interfaces/lists/class_Listable.php
1df8c4de0e9cd2bea031c5619e95ac34eaa8ec14
[core.git] / framework / main / interfaces / lists / class_Listable.php
1 <?php
2 // Own namespace
3 namespace Org\Mxchange\CoreFramework\Lists;
4
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
7 use Org\Mxchange\CoreFramework\Visitor\Visitable;
8
9 // Import SPL stuff
10 use \IteratorAggregate;
11
12 /**
13  * An interface for lists
14  *
15  * @author              Roland Haeder <webmaster@shipsimu.org>
16  * @version             0.0.0
17 <<<<<<< HEAD:framework/main/interfaces/lists/class_Listable.php
18  * @copyright   Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
19 =======
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
24  *
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.
29  *
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.
34  *
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/>.
37  */
38 interface Listable extends FrameworkInterface, IteratorAggregate {
39         /**
40          * Checks whether the given group is set
41          *
42          * @param       $groupName      Group to check if found in list
43          * @return      $isset          Whether the group is valid
44          */
45         function isGroupSet ($groupName);
46
47         /**
48          * Adds the given group or if already added issues a ListGroupAlreadyAddedException
49          *
50          * @param       $groupName      Group to add
51          * @return      void
52          * @throws      ListGroupAlreadyAddedException  If the given group is already added
53          */
54         function addGroup ($groupName);
55
56         /**
57          * Adds the given instance to list group and sub group
58          *
59          * @param       $groupName                      Group to add instance to
60          * @param       $subGroup                       Sub group to add instance to
61          * @param       $visitableInstance      An instance of Visitable
62          * @return      void
63          * @throws      NoListGroupException    If the given group is not found
64          */
65         function addInstance ($groupName, $subGroup, Visitable $visitableInstance);
66
67         /**
68          * Adds the given entry to list group
69          *
70          * @param       $groupName      Group to add instance to
71          * @param       $entry          An entry of any type
72          * @return      void
73          * @throws      NoListGroupException    If the given group is not found
74          */
75         function addEntry ($groupName, $entry);
76
77         /**
78          * Updates the given entry by hash with given array
79          *
80          * @param       $hash           Hash for this entry
81          * @param       $entryArray     Array with entry we should update
82          * @return      void
83          * @throws      InvalidListHashException        If the solved hash index is invalid
84          */
85         function updateCurrentEntryByHash ($hash, array $entryArray);
86
87         /**
88          * "Getter" for an iterator instance of this list
89          *
90          * @return      $iteratorInstance       An instance of a Iterator class
91          */
92         function getListIterator ();
93
94         /**
95          * Clears this list (mostly by clearing all groups together)
96          *
97          * @return      void
98          */
99         function clearList ();
100
101         /**
102          * Setter for call-back instance
103          *
104          * @param       $callbackInstance       An instance of a FrameworkInterface class
105          * @return      void
106          */
107         function setCallbackInstance (FrameworkInterface $callbackInstance);
108
109 }