From: Roland Haeder Date: Tue, 24 Mar 2015 20:19:20 +0000 (+0100) Subject: Also moved this interface (again more will come). X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1df0b6c9a2c3888c0d51cab6aaf5476db3bc17d4;p=core.git Also moved this interface (again more will come). Signed-off-by: Roland Häder --- diff --git a/inc/classes/interfaces/lists/.htaccess b/inc/classes/interfaces/lists/.htaccess new file mode 100644 index 00000000..3a428827 --- /dev/null +++ b/inc/classes/interfaces/lists/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/interfaces/lists/class_Listable.php b/inc/classes/interfaces/lists/class_Listable.php new file mode 100644 index 00000000..f3a60f92 --- /dev/null +++ b/inc/classes/interfaces/lists/class_Listable.php @@ -0,0 +1,89 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface Listable extends FrameworkInterface, IteratorAggregate { + /** + * Checks whether the given group is set + * + * @param $groupName Group to check if found in list + * @return $isset Whether the group is valid + */ + function isGroupSet ($groupName); + + /** + * Adds the given group or if already added issues a ListGroupAlreadyAddedException + * + * @param $groupName Group to add + * @return void + * @throws ListGroupAlreadyAddedException If the given group is already added + */ + function addGroup ($groupName); + + /** + * Adds the given instance to list group and sub group + * + * @param $groupName Group to add instance to + * @param $subGroup Sub group to add instance to + * @param $visitableInstance An instance of Visitable + * @return void + * @throws NoListGroupException If the given group is not found + */ + function addInstance ($groupName, $subGroup, Visitable $visitableInstance); + + /** + * Adds the given entry to list group + * + * @param $groupName Group to add instance to + * @param $entry An entry of any type + * @return void + * @throws NoListGroupException If the given group is not found + */ + function addEntry ($groupName, $entry); + + /** + * Updates the given entry by hash with given array + * + * @param $hash Hash for this entry + * @param $entryArray Array with entry we should update + * @return void + * @throws InvalidListHashException If the solved hash index is invalid + */ + function updateCurrentEntryByHash ($hash, array $entryArray); + + /** + * "Getter" for an iterator instance of this list + * + * @return $iteratorInstance An instance of a Iterator class + */ + function getListIterator (); + + /** + * Clears this list (mostly by clearing all groups together) + * + * @return void + */ + function clearList (); +} + +// [EOF] +?>