Question
import java.io.PrintWriter; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Scanner; import java.util.TreeSet; /** * The start of a Calendar ADT that could be the *
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.TreeSet;
/**
* The start of a Calendar ADT that could be the
* basis of a Calendar application.
*/
public class Calendar extends TreeSet
/**
* Keep Eclipse Happy
*/
private static final long serialVersionUID = 1L;
public Calendar() { }
/**
* Read lines from the scanner and convert each to an appointment
* @param s scanner to read from, must not be null
* @param errorMessages if a line doesn't read, print it with the
* error message.
*/
public void doImport(Scanner s, PrintWriter errorMessages) {
// TODO
}
/**
* Print all appointments in this calendar to the print writer given.
* @param pw output to send to, must not be null
*/
public void doExport(PrintWriter pw) {
// TODO
}
/**
* Return an iterator into this calendar starting at the given time.
* The iterator's next element (if any) will be the first appointment
* that starts on or after this time.
* @param t time to start at, must not be null
* @return iterator, never null
*/
public Iterator
return null; // TODO (see assignment)
}
/**
* Remove conflicts from this calendar.
* If it find two conflicting appointments, the second one is removed,
* and we don't worry about any further conflicts with the second one
* (but the non-removed one may still conflict with further appointments).
* @return a list of removed appointments.
*/
public List
return null; // TODO
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started