Added README.txt and GPL Header to Source Files
[DHBWCampusApp.git] / app / src / main / java / de / dhbwloe / campusapp / vorlesungen / CourseGroup.java
index 06475c175db19f64ef005350f0b53dc4790ff781..a8692300cd7e89ec3622a8736c09224c6d657f6a 100644 (file)
@@ -1,8 +1,27 @@
+/* CourseGroup.java
+ *
+ * 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/>.
+ */
 package de.dhbwloe.campusapp.vorlesungen;
-
+import android.os.Bundle;
 import android.provider.ContactsContract;
 
+import java.lang.reflect.Array;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import de.dhbwloe.campusapp.database.DatabaseManager;
 
@@ -17,6 +36,8 @@ public class CourseGroup {
     private boolean bIsNew = false;
     private ArrayList<CourseEvent> events = new ArrayList<CourseEvent>();
 
+    private Bundle extraData = new Bundle();
+
     public static CourseGroup GetCourseGroupById(DatabaseManager dbm, int id) {
         for(CourseGroup group : CourseGroups) {
             if(group.iCourseGroupId == id)
@@ -61,6 +82,14 @@ public class CourseGroup {
         return (CourseEvent[])this.events.toArray();
     }
 
+    public CourseEvent[] getOrderedCourseEvents() {
+        CourseEvent[] events = getCourseEvents();
+
+        Arrays.sort(events);
+
+        return events;
+    }
+
     public int getGroupId() {
         return iCourseGroupId;
     }
@@ -72,4 +101,12 @@ public class CourseGroup {
         return ret;
     }
 
+    public Bundle getExtraData() {
+        return extraData;
+    }
+
+    public String getGroupName() {
+        return sCourseGroupName;
+    }
+
 }