1 /* VorlesungsplanGroupsListItem.java
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 package de.dhbwloe.campusapp.fragments;
17 import java.text.SimpleDateFormat;
18 import java.util.Date;
20 import de.dhbwloe.campusapp.CampusAppContext;
21 import de.dhbwloe.campusapp.R;
24 * Created by pk910 on 20.02.2016.
26 public class VorlesungsplanGroupsListItem {
28 private String courseName;
29 private String groupName;
30 private long firstEvent, lastEvent, nextEvent, nextKlausurEvent;
31 private int eventCount;
33 public VorlesungsplanGroupsListItem(int groupid, String coursename, String groupname, long firstevent, long lastevent, int eventcount, long nextevent, long nextklausur) {
35 courseName = coursename;
36 groupName = groupname;
37 firstEvent = firstevent;
38 lastEvent = lastevent;
39 eventCount = eventcount;
40 nextEvent = nextevent;
41 nextKlausurEvent = nextklausur;
44 public int getGroupId() {
48 public String getCourseName() {
52 public String getGroupName() {
56 public String getFirstEvent() {
59 SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_fulldate));
60 Date date = new Date(firstEvent*1000);
61 return dateFormat.format(date);
64 public String getLastEvent() {
67 SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_fulldate));
68 Date date = new Date(lastEvent*1000);
69 return dateFormat.format(date);
72 public String getNextEvent() {
75 SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_fulldate));
76 Date date = new Date(nextEvent*1000);
77 return dateFormat.format(date);
80 public String getNextKlausurEvent() {
81 if(nextKlausurEvent == 0)
83 SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_fulldate));
84 Date date = new Date(nextKlausurEvent*1000);
85 return dateFormat.format(date);
88 public int getEventCount() {