Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use interface provided public interface ListOfString_Interface { /** * Adds the given element to the end of this list. * * @param str element to

use interface provided

image text in transcribed

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. 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_2

Step: 3

blur-text-image_3

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

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

Students also viewed these Databases questions