-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy pathEvent.java
More file actions
48 lines (44 loc) · 1.1 KB
/
Event.java
File metadata and controls
48 lines (44 loc) · 1.1 KB
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
/**
* Represents an Event task with a description, a "from" string, and a "to" string.
*/
public class Event extends Task {
private String from;
private String to;
/**
* Constructs an Event with the given description, from-string, and to-string.
*
* @param description The task description.
* @param from The start time/place.
* @param to The end time/place.
*/
public Event(String description, String from, String to) {
super(description);
this.from = from;
this.to = to;
}
/**
* Returns the "from" string.
*
* @return The from string.
*/
public String getFrom() {
return from;
}
/**
* Returns the "to" string.
*
* @return The to string.
*/
public String getTo() {
return to;
}
/**
* Returns a string representation of an Event task.
*
* @return "[E]" + status + description + " (from: ... to: ...)"
*/
@Override
public String toString() {
return "[E]" + super.toString() + " (from: " + from + " to: " + to + ")";
}
}