Goal & Objective The goal of this assignment is to develop proficiency with Cursor Based Lists. The objective of part 1 is to practice analyzing a given ADT using problem instances. Task The ADT you...

1 answer below »

Goal & Objective


The goal of this assignment is to develop proficiency with Cursor Based Lists. The objective of part 1 is to practice analyzing a given ADT using problem instances.

Task


The ADT you are to implement isListADT.ListADTis the specification of a Cursor Based List. This ADT is specified in Java using an interface. The interface lists and defines the methods that comprise this ADT. The fileListADT.pdf
describes this interface. In part 1, you will analyze this ADT by developing problem instances.

Problem Instances


Study the interface. You are to develop a set of problem instances for each method and enter them into the asg file. Study the sections "TestCases Specification Notation" in the last chapter "CNU Tips" of our textbook (canvas). This will provide guidance for completing part 1. Follow the guidelines of the previous assignment for theasgfile. Use the ATA plugin to create the problem instances for the ADT. Your asg file must be namedAsg2.asg. The adt should be set equal to ListADT and the impl should be set equal to ListRaIMP.


ListADT 9/23/21, 10:20 AMListADT Page 1 of 4file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/ListADT.html PACKAGE CLASS USE TREE DEPRECATED INDEX HELP PREV CLASS NEXT CLASS FRAMES NO FRAMES ALL CLASSES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD Interface ListADT public interface ListADT ListADT is a cursor based list of char. Version: 20210921 Author: acsiochi Method Summary Modifier and Type Method and Description boolean equals(java.lang.Object o) Determines if o is equal to this ListADT. char get() Get the current element. void insert(int c) Adds c to this ListADT at the current position. boolean next() Moves the cursor one position towards the tail of the list. boolean prev() Moves the cursor one position towards the head of the list. void remove() Removes the current element from this list. char[] toArray(int s, int f) Produces an array containing the list elements from position s to position f, All Methods Instance Methods Abstract Methods file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/package-summary.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/class-use/ListADT.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/package-tree.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/deprecated-list.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/index-files/index-1.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/help-doc.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/index.html?ListADT.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/ListADT.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/allclasses-noframe.html javascript:show(2); javascript:show(4); Antonio Siochi Antonio Siochi char 9/23/21, 10:20 AMListADT Page 2 of 4file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/ListADT.html not including f. java.lang.String toString() Gets a String representation of the state of this list. Method Detail equals boolean equals(java.lang.Object o) Determines if o is equal to this ListADT. o can't be null and must be an object of a class that implements ListADT. Overrides: equals in class java.lang.Object Parameters: o - reference to object to check for equality Returns: true if this equals o, false else get char get() throws java.util.NoSuchElementException Get the current element. If it is not possible to do so, throw a NoSuchElementException. Returns: the current element Throws: java.util.NoSuchElementException - if it is not possible to get insert void insert(int c) Adds c to this ListADT at the current position. If it not possible to add then just return. Parameters: Antonio Siochi Antonio Siochi char 9/23/21, 10:20 AMListADT Page 3 of 4file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/ListADT.html c - char to add next boolean next() Moves the cursor one position towards the tail of the list. Returns: true if it was possible to move, false else prev boolean prev() Moves the cursor one position towards the head of the list. Returns: true if it was possible to move, false else remove void remove() Removes the current element from this list. If it is not possible to do so then just return (silently fail). toString java.lang.String toString() Gets a String representation of the state of this list. This String starts with a "<" and="" ends="" with="" a="" "="">". In between are the elements of this list separated by commas, except that a pipe replaces the comma before the current element. There are no spaces after the "<", before="" the="" "="">", nor around the commas nor the pipe. Examples of valid String representations are shown here:<|> Overrides: toString in class java.lang.Object 9/23/21, 10:20 AMListADT Page 4 of 4file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/ListADT.html PACKAGE CLASS USE TREE DEPRECATED INDEX HELP PREV CLASS NEXT CLASS FRAMES NO FRAMES ALL CLASSES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD Returns: string representation of the list's state toArray char[] toArray(int s, int f) Produces an array containing the list elements from position s to position f, not including f. Calling toArray(1,3) on the list with state will produce the array {b, c}. No change is made to the list. Parameters: s - starting position f - finishing position (not included in the returned array) Returns: reference to array containing the copied elements. file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/package-summary.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/class-use/ListADT.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/package-tree.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/deprecated-list.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/index-files/index-1.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/help-doc.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/index.html?ListADT.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/ListADT.html file:///Users/acsiochi/Dropbox/Work%20(Selective%20Sync%20Conflict)/teaching/Classes/classesGit/270FA21/asg2-listadt/doc/allclasses-noframe.html Antonio Siochi Antonio Siochi
Answered 1 days AfterSep 29, 2021

Answer To: Goal & Objective The goal of this assignment is to develop proficiency with Cursor Based Lists. The...

Arun Shankar answered on Sep 30 2021
148 Votes
List_Project/.classpath

    
        
            
        
    
    
    
List_Project/.project

     List_Project
    
    
    
    
        
             org.eclipse.jdt.core.javabuilder
            
            
        
    
    
        ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here