-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalendar.java
28 lines (22 loc) · 1.15 KB
/
Calendar.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
import java.util.Date;
import java.util.List;
public interface Calendar {
// Return a list of all appointments at the given location (at any time)
// If there are no such appointments, return an empty list
// Throws IllegalArgumentException if the argument is null
public List<Appointment> getAppointments(String location);
// Return the next appointment at or after the given time (in any location)
// If there is no such appointment, return null
// Throws IllegalArgumentException if the argument is null
public Appointment getNextAppointment(Date when);
// Return the next appointment at or after the given time, at that location
// If there is no such appointment, return null
// Throws IllegalArgumentException if any argument is null
public Appointment getNextAppointment(Date when, String location);
// Create a new appointment in the calendar
// Throws IllegalArgumentException if any argument is null
public void add(String description, Date when, String location);
// Remove an appointment from the calendar
// Throws IllegalArgumentException if the argument is null
public void remove(Appointment appointment);
}