-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvent.java
97 lines (83 loc) · 2.06 KB
/
Event.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package com.company;
/**
* The Events is a class for all the events that we use in the problem.
* <p>Each Event has:</p>
* <ul>
* <li>a name
* <li>a number of participants (its size)
* <li>a start time
* <li>an end time
* </ul>
*
* @author Stratan Corina
*/
public class Event {
private String name;
private int numOfParticipants;
private int startTime;
private int endTime;
public Event(String name, int numOfParticipants, int startTime, int endTime) {
this.name = name;
this.numOfParticipants = numOfParticipants;
this.startTime = startTime;
this.endTime = endTime;
}
/**
*Indicates whether some other Event is "equal to" this one
*
* @param o some other object
* @return true or false
*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Event event = (Event) o;
return numOfParticipants == event.numOfParticipants && startTime == event.startTime && endTime == event.endTime && name.equals(event.name);
}
/**
* @return the name of the Event
*/
public String getName() {
return name;
}
/**
* @return the number of the participants
*/
public int getNumOfParticipants() {
return numOfParticipants;
}
/**
* @return the start time
*/
public int getStartTime() {
return startTime;
}
/**
*
* @return the end time
*/
public int getEndTime() {
return endTime;
}
/**
*
* @param name name of the room
*/
public void setName(String name) {
this.name = name;
}
public void setNumOfParticipants(int numOfParticipants) {
this.numOfParticipants = numOfParticipants;
}
public void setStartTime(int startTime) {
this.startTime = startTime;
}
public void setEndTime(int endTime) {
this.endTime = endTime;
}
@Override
public String toString() {
return name ;
}
}