Archived
Categories are now fully working.
This commit is contained in:
1 parent
104f780b3f
commit
911c2edd10
3 files changed
+17
-12
No files matched your search
@@ -1,10 +1,14 @@
|
||||
package com.studentersamfundet.app;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class DataHandler {
|
||||
private LinkedList<Event> events = new LinkedList<Event>();
|
||||
|
||||
private List<Event> events = new LinkedList<Event>();
|
||||
private Set<String> categories = new TreeSet<String>();
|
||||
|
||||
public void insert(String id, String title, String description, String date, String location, String text, String category) {
|
||||
int intId = Integer.parseInt(id);
|
||||
if (get(intId) != null)
|
||||
@@ -12,6 +16,7 @@ public class DataHandler {
|
||||
|
||||
Event e = new Event(intId, title, description, date, location, text, category);
|
||||
events.add(e);
|
||||
categories.add(category);
|
||||
}
|
||||
|
||||
public Event get(int id) {
|
||||
@@ -35,4 +40,8 @@ public class DataHandler {
|
||||
}
|
||||
return sorted.toArray(new Event[sorted.size()]);
|
||||
}
|
||||
|
||||
public String[] getCategories() {
|
||||
return categories.toArray(new String[categories.size()]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user