Commit 28f2471f authored by s7_spruge_k's avatar s7_spruge_k
Browse files

Added event class

parent 5fdbf143
package com.example.models;
import java.util.ArrayList;
import java.util.Date;
public class Event {
private String name;
private String description;
private Date startDate;
private Date endDate;
private int event_ID;
private EventType eventType;
private static ArrayList<Event> allEvents;
//TODO add set/get functions to constructor
//Constructor, all parameters
public Event(String name, String description, Date startDate, Date endDate, EventType eventType) {
super();
this.name = name;
this.description = description;
this.startDate = startDate;
this.endDate = endDate;
this.eventType = eventType;
}
//Constructor, no event type
public Event(String name, String description, Date startDate, Date endDate) {
super();
this.name = name;
this.description = description;
this.startDate = startDate;
this.endDate = endDate;
}
//Constructor no description or eventType
public Event(String name, Date startDate, Date endDate) {
super();
this.name = name;
this.startDate = startDate;
this.endDate = endDate;
}
//Set & Get
//TODO set/get verification
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public int getEvent_ID() {
return event_ID;
}
public static ArrayList<Event> getAllEvents() {
return allEvents;
}
@Override
public String toString() {
return "Event: " + name + ", description: " + description + " startDate: " + startDate + ", endDate: "
+ endDate + ", event_ID: " + event_ID;
}
}
package com.example.models;
public enum EventType {
Birthday, Lecture, Appointment, Reminder
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment