Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 starting(Time t) {

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 removeConflicts() {

return null; // TODO

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions