List

Introduction

In this homework assignment, you will be exploring the implementation of interfaces. You can think of an interface as a skeleton for a type of object; interfaces give method signatures that must be implemented in any class, which implements the interface. Click this link to learn more about interfaces: https://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html Remember to refer to the Java API if you are struggling with the concept of interfaces: https://docs.oracle.com/javase/10/docs/api/overview-summary.html

Problem Description

You will be implementing the methods from the interface, List, into the concrete class, MyList. You will also be using IllegalArgumentException and IndexOutOfBoundsException. Make sure to check Piazza for updates. There will not be announcements about clarifications on homeworks.

List

This interface is already written and provided for you: List.java

It has the following fields:

It has the following methods:

MyList

Represents a custom array list with generics. Should implement List. When the add method is called and the backing array is full, double the size of the backing array then add the element.

It has the following instance fields:

It has the following constructors:

NOTE: Since the class implements List, it should implement all the methods declared in the interface.

Imports

For this homework, you may not import classes, especially those from java.util. Any imports will result in major points deductions.

Grading

This is a tentative rubric and may be changed.

MyList.java

Tips & Considerations

Javadocs

You will need to write Javadoc comments for this homework.

Checkstyle

You will be required to follow checkstyle. For each violation the tool finds, you will lose one point on your total grade for this assignment.

For this homework, the checkstyle cap is 100, meaning you can lose up to 100 points on this assignment due to style errors. Run checkstyle early, and get in the habit of writing style compliant code the first time. Don’t wait until 5 minutes before the deadline to find out that you have 100+ violations.

Submission

Submit your MyList.java file as attachments to the hw5 assignment on Canvas. You can submit as many times as you want, so feel free to submit as you make substantial progress on the homework. We only grade your last submission, meaning we will ignore any previous submissions. Submit every file every time you resubmit.

As always, late submissions will not be accepted and non-compiling code will be given a score of 0. MyList.java must compile with List.java to receive credit. For this reason, we recommend submitting early and then confirming that you submitted ALL of the necessary files by re-downloading your file(s) and compiling/running them.

Good luck, and have fun!