Archived
Work done so far.
This commit is contained in:
1 parent
fe9a6aed20
commit
5fdcbfac04
38 files changed
+539
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package com.studentersamfundet.app;
|
||||
|
||||
public class DataHandler {
|
||||
Event events;
|
||||
|
||||
void insert(String id, String title, String description, String date, String location, String category) {
|
||||
int intId = Integer.parseInt(id);
|
||||
if (get(intId) != null)
|
||||
return;
|
||||
|
||||
Event e = new Event(intId, title, description, date, location, category);
|
||||
|
||||
if (events == null)
|
||||
events = e;
|
||||
else {
|
||||
Event tmp = events;
|
||||
while (tmp.next != null)
|
||||
tmp = tmp.next;
|
||||
tmp.next = e;
|
||||
}
|
||||
}
|
||||
|
||||
Event get(int id) {
|
||||
Event e = events;
|
||||
while (e != null && e.id != id)
|
||||
e = e.next;
|
||||
return e;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user