Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/** * A singly-linked list of Strings. * * */ public interface ListOfString_Interface { /** * Adds the given element to the end of this

image text in transcribed

/** * A singly-linked list of Strings. * * */ public interface ListOfString_Interface { /** * Adds the given element to the end of this list. * * @param str element to be added to the end of this list */ void add(String str); /** * Adds the given element at the given index position i. * * @param i index position where the given element will be added * @param str element to be added at the given index position * @throws IndexOutOfBoundsException if i  size() Note: that * it is OK for i to equal size() */ void add(int i, String str) throws IndexOutOfBoundsException; /** * Adds the given element to the beginning of this list. * * @param str element to be added to the beginning of this list */ void addFirst(String str); /** * Adds the given element to the end of this list. * * @param str element to be added to the end of this list */ void addLast(String str); /** * Removes all list elements, if any exist. */ void clear(); /** * Returns true if the specified element in in this list, returns false * otherwise. * * @param str element that is being searched for * @return true if the specified element is in this list, returns false * otherwise */ boolean contains(String str); /** * Returns the index of the first occurrence of the specified element, -1 if * the element is not in this list * * @param str element being searched for * @return index of the first occurrence of the specified element, returns * -1 if the element is not in this list */ int firstIndexOf(String str); /** * Returns the element at the given index position. * * @param i index of the list element to return * @return the element located at the given index position * @throws IndexOutOfBoundsException if i  

For this assignment you are to use NetBeans to implement the interface named ListOfString_Interface provided with this assignment. Below are additional details for this assignment. Details 1. Your class must be named SLinked_ListOfString. 2. It must implement the interface ListOfString_Interface. 3. The class for the singly linked list nodes must be named SNode_String. 4. Your class should not have a main method. If you want to test your class, you should write a separate program. 5. Your class must have exactly three instance variables (no more, no less): a. An SNode_String object referencing the head of the linked list. b. An SNode_String object referencing the tail of this linked list. c. An int to hold the size of the list. 6. Your class must have a single constructor that sets the head and tail nodes to null and sets the size to zero. 7. Your class must include all the methods specified in the ListOfString_Interface. See the comments provided in the interface for details on what each method is supposed to do. You can also look at the HTML documentation generated from the Javadoc comments. 8. The interface methods that your class implements must all include the @0verride annotation. Tester Program You are being provided with a Tester program, called ListOfString_Tester. If your SLinked_ListOfString class is working correctly it will print a message indicating that all tests were passed, otherwise error messages will be printed

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

Students also viewed these Databases questions

Question

Briefly describe the process of computing a corporation's AMT.

Answered: 1 week ago