Question
ListInterface.java:- package listInterface; public interface ListInterface { int size(); // return the number of elements on this list boolean isEmpty(); void add(E element); boolean remove
ListInterface.java:-
package listInterface;
public interface ListInterface
int size(); // return the number of elements on this list
boolean isEmpty();
void add(E element);
boolean remove (E element);
// remove an element e from this list such that
e.equals(element) and return true;
// if no such element exists, return false
boolean contains (E element);
// return true if this list contains an element e such that
e.equals(element);
// otherwise, return false
E get(E element);
// return an element e from this list such that
e.equals(element);
// if no such element exists, return null
String toString();
// returns an appropriately formatted string that represents
this list.
void resetIterator();
// set the current position for the getNext() iterator to
the first element on the list
E getNextItem();
// Preconditions: The list is not empty
// The resetIterator() method has been
invoked
// The list has not been modified since the
most recent resetIterator() call
//
// return the element at the current position on this list;
// update the current pointer to point to the next element
on the list
// note: if the element returned is the last item on the
list,
// set the value of the current position to the first
element on the list
}
LLNode.java:-
package nodes;
public class LLNode
private E info;
private LLNode
public LLNode(E info) {
this.info = info;
next = null;
}
public E getInfo() {
return info;
}
public void setInfo(E info) {
this.info = info;
}
public LLNode
return next;
}
public void setNext(LLNode
this.next = next;
}
}
Each student will be assigned one of the two List ADTs described further below. The List ADTs are to implement the attached Listinterface java, and include a toString0 method. The underlying data structure for each implementation shall be a singly linked list that uses the attached LLNode.java node class. A test program must also be developed. This program must verify each of the ADT operations and be consistent with the test plan Required elements all of your source code in a single Eclipse project partial test plan o identify what the goals of your testing are, and describe what your approach to testing will be in order to meet these goals exhaustive set of remove operation test cases nota bene: this a test plan, not a report of the testing you actually did o List ADT with a circular linked list as the underlying data structure List elements are to be maintained in the underlying linked list in insertion order, and the next instance variable for the most recently inserted node must point to the first, or "oldest", node on the list In addition to the operations included in Listlnterface.java, and the toString0 method, this list ADT must have a gnirtSot) method that returns a string that represents all of the list items presented in the reverse of their insertion order: toString) is to show the list items in insertion order, and gnirtSot0 is to show them in the opposite order The name of your list ADT class must be CircularList. The class header will look like this: public class CircularList
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started