Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

We use Eclipse IDE Part I: Create a doubly linked circular list class named LinkedItemList that implements the following interface: /** * An ordered list

We use Eclipse IDE

Part I:

Create a doubly linked circular list class named LinkedItemList that implements the following interface:

/**

* An ordered list of items.

*/

public interface ItemList {

/**

* Append an item to the end of the list

*

* @param item item to be appended

*/

public void append(E item);

/**

* Insert an item at a specified index position

*

* @param item item to be inserted

* @param index index position where to insert the item

* @throw IndexOutOfBoundsException if index is < 0 or > no of items

*/

public void insert(E item, int index);

/**

* Return an item at a specified index

*

* @param index index of the item to return

* @return the item at the specified index

* @throw IndexOutOfBoundsException if index is < 0 or >= no of items

*/

public E get(int index);

/**

* Remove an item at a specified index

*

* @param index index of the item to be removed

* @return the removed item

* @throw IndexOutOfBoundsException if index is < 0 or >= no of items

*/

public E removeAtIndex (int index);

/**

* Return the number of items currently in the list

*

* @return the number of items in the list

*/

public int size();

/**

* Determine if the list is empty

*

* @return true if the list is empty, otherwise false

*/

public boolean isEmpty();

/**

* Clear the list. The list becomes empty

*

*/

public void clear();

}

You will need the appropriate constructors. In addition, you may also implement other methods that may be useful for the assignment (where possible define code in just one place).

Part II:

Write JUnit test program to thoroughly test all of the methods of your LinkedItemList class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions