-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathEvent.java
More file actions
65 lines (51 loc) · 1.15 KB
/
Event.java
File metadata and controls
65 lines (51 loc) · 1.15 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package codewithcal.au.calendarappexample;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.ArrayList;
public class Event
{
public static ArrayList<Event> eventsList = new ArrayList<>();
public static ArrayList<Event> eventsForDate(LocalDate date)
{
ArrayList<Event> events = new ArrayList<>();
for(Event event : eventsList)
{
if(event.getDate().equals(date))
events.add(event);
}
return events;
}
private String name;
private LocalDate date;
private LocalTime time;
public Event(String name, LocalDate date, LocalTime time)
{
this.name = name;
this.date = date;
this.time = time;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public LocalDate getDate()
{
return date;
}
public void setDate(LocalDate date)
{
this.date = date;
}
public LocalTime getTime()
{
return time;
}
public void setTime(LocalTime time)
{
this.time = time;
}
}