Question: **Node class** public class Node { public String value; public Node next; public Node(String value) { super(); this.value = value; } @Override public String toString()





**Node class**
public class Node {
public String value;
public Node next;
public Node(String value) {
super();
this.value = value;
}
@Override
public String toString() {
return value;
}}
**SinglyLinkedList interface**
package singlylinkedlist;
import java.io.*; import java.util.*;
/** * Defines the interface for a singly-linked list. * */ public interface SinglyLinkedList {
/** * @return Reference to the first node. If the list is empty, this method returns null. */ public Node getFirst(); /** * @return Reference to the last node . If the list is empty, this method returns null. */ public Node getLast(); /** * @return Number of nodes in the list */ public int size(); /** * @return true if the list has no nodes; false otherwise */ public boolean isEmpty(); /** * Removes all nodes in the list. */ public void clear(); /** * Inserts a new node with the given value after n. * * @param cursor The node to insert after. Set this to null to insert value as the new first Node. * @param value The value to insert * @return a reference to the newly inserted Node */ public Node insert(Node cursor, String value); /** * Inserts a new node with the given value at the "end" of the list. * * @param value * @return a reference to the newly inserted Node */ public Node append(String value); /** * Removes the specified Node from the list. * * @param cursor A reference to the Node to remove. */ public void remove(Node cursor); /** * Returns a reference to the first Node containing the key, starting from the given Node. * * @param start * @param key * @return a reference to the first Node containing the key */ public Node find(Node start, String key); /** * @return a comma-separated String of the values in the list. Don't add any spaces between the values. */ public String toCsvString(); /** * @return an ArrayList * These are * the days * you'll remember *
* * then the resulting list would be: * * These are -> the days -> you'll remember -> null * * @param filename Path to the file * @throws IOException */ public void loadFile(String filename) throws IOException; /** * Saves values from the nodes in the list to the specified file; one line in the file for each node in the list. * * @param filename Path to the file * @throws IOException */ public void saveFile(String filename) throws IOException;
}
The language is java
THE DETAILS NOTE: If the names don't match those described below exactly, your project will not compile and can't be graded. 1. Right click on the JavaCore Template project and select Copy. Right-click in an empty area of the Package Explorer and select Paste. The project name must follow this pattern: {FLname}_SinglyLinkedList_{TERM}, where {FLname} is replaced by the first letter of your first name plus your last name, and {TERM} is the semester and year. E.g. if your name is Maria Marciano and it's Fall of 2025, your project name must be MMarciano_SinglyLinkedList_F25. 2. Create a new package in the src folder called singlylinkedlist. 1 3. The Node class: THIS a. The BasicSinglyLinkedList class that you will be writing (see below) must use a Node to hold each item in the linked list. b. Download Node.java (click the link, then the sublink) and copy into your singlylinkedlist package folder. c. You do not modify Node.java. U 4. The SinglyLinkedList interface: a. An interface is a contract. Implementors must have all of the methods that the interface lists. b. The BasicSinglyLinkedList class that you will be writing (see below) must implement the SinglyLinkedList interface. C. Download SinglyLinkedList.java (click the link, then the sublink) and into your singlylinkedlist package folder. d. You will need to read the comments above each method declaration in SinglyLinkedList.java to see what each method is supposed to do. e. You do not modify SinglyLinkedList.java. You will be adding your code to BasicSinglyLinkedList.java (see below). THIS THAT 5. The BasicSinglyLinkedList class: a. This is the class that you must write. b. In the Package Explorer, select the singlylinkedlist package | New Class. c. In the wizard, set the name to BasicSinglyLinkedList. Then click the Add (interface) button, and search for SinglyLinkedList. Check the "Inherited abstract methods" box. Click Finish. Eclipse will create the class and automatically add method stubs that meet the SinglyLinkedList interface. d. You will need to read the comments above each method declaration in SinglyLinkedList.java to see what each method is supposed to do. AND THOTHER 6. The SinglyLinkedListTester: a. This is the grading script. It verifies that BasicSinglyLinkedList performs its operations correctly and efficiently. b. Create a new package in the src folder called sbccunittest. To be clear: sbccunittest should be a child of the src folder, not of the singlylinkedlist package. Mics! GRUNGE NIRVANA DC PE JAM ock MUD HONLY THEary UND GARDEN METAL ICE IN CHAINS PES BLE (wk/sexpositors PATI SA THE CLASH Beco 103 Richto HEL ARAMOS = 1803 DEAS 6ZAPPA 2 C. Download SinglyLinkedList Tester.java (click the link, then the sublink) and to the sbccunittest package. d. You do not modify SinglyLinkedListTester.java. And be sure that you don't accidentally allow Eclipse to modify it for you by accepting any Eclipse Quick Fixes that that it may offer that would change SinglyLinkedListTester. 7. At this point, your project should look something like this: csStrenn_SinglyLinkedList_F25 src v sbccunittest > SinglyLinkedListTester.java #singlylinkedlist > BasicSinglyLinkedlist.java > Main.java > Node.java > SinglyLinkedList.java > *\JRE System Library [jdk-12.0.2] > Referenced Libraries > Blib > Bpmd_min cs 106.ruleset TASKS & REQUIREMENTS 1. Your overall goal is to pass all of the tests. Start by getting testInsertOne() to pass: a. testInsertOne() verifies that your linked list class can be instantiated and that one node can be inserted into it correctly. b. To get the test to pass, you'll need to implement: the constructor, getFirst(), size(), and insert(). 2. Next, work on testInsert(), which verifies that items can be inserted into an empty list, at the end of the list, and in the middle of the list. b To get testinsert() to pass, you'll need to correctly implement: insert() and getLast()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
