Question Details

(Solved) I need to debug MedLisRefBased.java by passing all the tests from


I need to debug MedLisRefBased.java by passing all the tests from running MedListTester.java


/**

 

* CSC115 Assignment 2 : Containers.

 

* List.java

 

* Created for use by CSC115 Spring2016

 

*/

 

/*

 

* NOTE TO PROGRAMMER:

 

* Do not alter this file!

 

*/

 

/**

 

* A completed interface for a list container.

 

* This ADT specification is similar, but not identical to the List ADT

 

* described in the textbook.

 

*/

 

public interface List<E> {

 

/**

 

* Inserts an item to into the list at postion index.

 

* All items after the new item will have their index position increased

 

by one.

 

* For example, if <code>list</code> is a list of integers {1,2,3}, then

 

* <code>list.add(9,0)</code> will alter the list to contain {9,1,2,3} in

 

* that order.

 

* @param item The object to add to the front of the list.

 

* @param index The index position for the new item.

 

* Note that the index position may be equal to the number of items,

 

meaning that

 

* the item will be placed at the end of the list.

 

* @throws ListIndexOutOfBoundsException if the index is outside(0

 

… size).

 

*/

 

public void add(E item, int index);

 

/**

 

* Removes the item at the index position of the list.

 

* @param index The index number.

 

* @throws ListIndexOutOfBoundsException if the index is outside (0

 

… size-1).

 

*/

 

public void remove(int index);

 

/**

 

* Accesses the item by its position in the list.

 

* @param index The index of the position.

 

* @return The item at that index position.

 

* @throws ListIndexOutOfBoundsException if the index is outside (0

 

… size-1).

 

*/

 

public E get(int index);

 

/**

 

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

 

*/

 

public boolean isEmpty();

 

/**

 

* @return The number of items in the list.

 

*/

 

public int size();

 

/**

 

* Determines if the equivalent item is in the list.

 


 

* If it is in the list, then the index location is returned.

 

* If it is not, then -1 is returned.

 

* @param item The item that is equivalent to the item we are looking for.

 

* @return The index position of the equivalent item or -1 if it is not in

 

the list.

 

*/

 

public int find(E item);

 

/**

 

* Removes all the items from the list, resulting in an empty list.

 

*/

 

public void removeAll();

 

/**

 

* Removes all matching items from the list.

 

* For example, if the list is made up of integers and contains

 

{67,12,13,12},

 

* then <code>remove(12)</code>

 

* will alter the list to {67,13}.

 

* @param value The item that identies what to remove.

 

*

 

Any item in the list that matches this item will be removed.

 

*

 

Note that if no matching item can be found, then nothing is removed.

 

*/

 

public void remove(E value);

 

/**

 

* A printout of the list is in the form:

 

* <code>List: {<item1>,

 

*

 

<item2>,

 

*

 

…,

 

*

 

<last item>}

 

* </code>

 

* where each item is the string returned by its <code>toString</code>

 

method.

 

* Note that all the items can be listed on one line or placed on separate

 

lines, depending on the

 

* aesthetics.

 

* An empty list is represented by <code>List: {}</code>

 

* @return The string representation of the list, formatted as above.

 

*/

 

public String toString();

 

}

 


 

 


Solution details:

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Oct 15, 2019

EXPERT

Tutor

ANSWER RATING

YES, THIS IS LEGAL

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now