Also moved this interface (again more will come).
authorRoland Haeder <roland@mxchange.org>
Tue, 24 Mar 2015 20:19:20 +0000 (21:19 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 24 Mar 2015 20:19:20 +0000 (21:19 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/interfaces/lists/.htaccess [new file with mode: 0644]
inc/classes/interfaces/lists/class_Listable.php [new file with mode: 0644]

diff --git a/inc/classes/interfaces/lists/.htaccess b/inc/classes/interfaces/lists/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -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 (file)
index 0000000..f3a60f9
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/**
+ * An interface for lists
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+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]
+?>