alpha 0.0.1
[DHBWCampusApp.git] / app / src / main / java / de / dhbwloe / campusapp / fragments / VorlesungsplanGroupsListItem.java
1 package de.dhbwloe.campusapp.fragments;
2
3 import java.text.SimpleDateFormat;
4 import java.util.Date;
5
6 /**
7  * Created by pk910 on 20.02.2016.
8  */
9 public class VorlesungsplanGroupsListItem {
10     private int groupId;
11     private String courseName;
12     private String groupName;
13     private long firstEvent, lastEvent, nextEvent, nextKlausurEvent;
14     private int eventCount;
15
16     public VorlesungsplanGroupsListItem(int groupid, String coursename, String groupname, long firstevent, long lastevent, int eventcount, long nextevent, long nextklausur) {
17         groupId = groupid;
18         courseName = coursename;
19         groupName = groupname;
20         firstEvent = firstevent;
21         lastEvent = lastevent;
22         eventCount = eventcount;
23         nextEvent = nextevent;
24         nextKlausurEvent = nextklausur;
25     }
26
27     public int getGroupId() {
28         return groupId;
29     }
30
31     public String getCourseName() {
32         return courseName;
33     }
34
35     public String getGroupName() {
36         return groupName;
37     }
38
39     public String getFirstEvent() {
40         SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
41         Date date = new Date(firstEvent*1000);
42         return dateFormat.format(date);
43     }
44
45     public String getLastEvent() {
46         SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
47         Date date = new Date(lastEvent*1000);
48         return dateFormat.format(date);
49     }
50
51     public String getNextEvent() {
52         SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
53         Date date = new Date(nextEvent*1000);
54         return dateFormat.format(date);
55     }
56
57     public String getNextKlausurEvent() {
58         if(nextKlausurEvent == 0)
59             return null;
60         SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
61         Date date = new Date(nextKlausurEvent*1000);
62         return dateFormat.format(date);
63     }
64
65     public int getEventCount() {
66         return eventCount;
67     }
68 }