Skip to content
Snippets Groups Projects
Commit 2a3891cc authored by mq1g18's avatar mq1g18
Browse files

Added java files for Activity, Event and Complaint

parent 2c004e31
No related branches found
No related tags found
No related merge requests found
import java.util.ArrayList;
public abstract class Activity {
// private String type;
private String title;
protected ArrayList<Group> groups;
private String description;
private User host;
public Activity (/*String type,*/ String title, String description, User host){
/*this.type = type;*/
this.title = title;
this.description = description;
this.host = host;
groups = new ArrayList<Group>();
}
ArrayList<Group> getGroups(){
return groups;
}
String getTitle(){
return title;
}
User getHost(){
return host;
}
String getDescription(){
return description;
}
}
import java.util.Date;
public class Complaint extends Activity {
private boolean anonymous;
public Complaint (/*String type,*/ String title, String description, User host, boolean anonymous){
super(/*type,*/title,description,host);
this.anonymous = anonymous;
}
boolean getAnonymous(){
return anonymous;
}
}
import java.util.ArrayList;
import java.util.Date;
public class Event extends Activity {
Date date;
String location;
public Event (/*String type,*/ String title, String description, User host, Date date, String location){
super(/*type,*/title,description,host);
this.date = date;
this.location = location;
}
void addGroup(Group group){
groups.add(group);
}
void addGroups(ArrayList<Group> groupsToAdd){
groupsToAdd.forEach((g) -> groups.add(g));
/*for (Group g : groupsToAdd){
groups.add(g);
}*/
}
void removeGroup(Group group){
groups.remove(group);
}
void removerGroups(ArrayList<Group> groupsToRemove){
groupsToRemove.forEach((g) -> groups.remove(g));
}
void setDate (Date date){
this.date = date;
}
Date getDate(){
return date;
}
void setLocation(String location){
this.location = location;
}
String getLocation(){
return location;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment