[Solved]Create Arraylist Alist Index Based List Similar Functionality Java S Arraylist Except Base Q37186902
Need This in JAVA Code 


Create an ArrayList (AList) that is an index-based List that is similar in functionality to Java’s ArrayList, except it will be based on a Node-based Doubly Linked List with Sentinels (not on arrays or ArrayLists) This AList class must extend DLL . implement AListADT use generics throughout include findNode0, the private worker method specified below: findNode0 must use the following definition: . private DLLNode findNode(int index) throws IndexOutOfBoundsException . each of the index-based methods must call findNode0, since all of them will need to find a DLLNode using an index. When your project is complete, and all provided files are part of your project, and you run the testers, the output of each of the testers should be exactly as shown in the tester output documents provided. AList.java must do all of the following · include a complete Code Header using the required format (code not accepted without this) For the output section, state whether or not your output matches the required output exactly, and, if not, what is different. Don’t paste in a copy of the output file. compile successfully using provided files with no changes (code not accepted without this) run without exceptions (code not accepted without this) include appropriate asserts include appropriate pre- and post- condition comments for most methods throw exceptions for any operation that should not take place on an emptylist throw exceptions for any operation that uses an out-of-bounds index (too high, toolow) Testing add(element) The AList: Item added: 11. The AList: (11) Item added: 33. The AList: (11, 33 h Item added: 55. The AList: (11, 33, 55 ) Item added: 77. The AList: (11, 33, 55, 77) Testing add(index, element) Item inserted at index 2: 200. The AList: 11, 33, 200, 55, 77) Item inserted at index 4: 400. The AList: 11, 33, 200, 55, 400, 77 Testing get(index) There are 6 items in the list: Item(0): 11. Item(1): 33. Item(2): 200. Item(3): 55. Item(4): 400. Item(5): 77 Items added: 22, 44, 66, 88 The AList: 11, 33, 200, 55, 400, 77, 22, 44, 66, 88) There are 10 items in the list, Testing set(index, element) Set Item(4) to 22. The AList: (11, 33, 200, 55, 22,77, 22,44, 66, 88 Set Item(8) to 44. The AList: (11, 33, 200, 55, 22,77, 22,44, 44, 88 Testing contains(element) The AList contains 77 The AList does not contain 123 Testing remove(index) Removed Item(3): 55. The AList: 11, 33, 200, 22,77, 22, 44,44, 88 ) Removed Item(5): 22. The AList: 11, 33, 200, 22,77,44, 44, 88 ) There are 8 items in the list. Testing remove(element) Removed item containing 11. The AList:33, 200, 22,77,44, 44, 88) Cannot remove 99. Not in AList. Testing indexOf(element) The first occurrence of 44 is at index: 4 The AList does not contain 10 Reset AList elements to 0-6 The AList: 10, 1, 2, 3, 4, 5, 6) Is the list empty? false Removed Item(0): 0 The AList:1, 2, 3,4,5, 6h Removed Item(0): 1 The AList: 2, 3, 4, 5, 6) Removed Item(O): 2 The AList:3, 4, 5,6) Removed Item(0): 3 The AList: 4, 5, 6h Removed Item(O): 4 The AList: (5, 6) Removed Item(0): 5 The AList:6 Removed Item(0): 6 The AList: Is the list empty? true Item added: (Amy-1). The AList: (Amy-1) ) Item added: (Bob-2). The AList: f (Amy-1), (Bob-2)h Item added: (Cal-3). The AList: (Amy-1), (Bob-2), (Cal-3) ) Item added: (Dot-4). The AList:(Amy-1), (Bob-2), (Cal-3), (Dot-4) ) Testing add(index, element) Item inserted at index 2: (Eli-5). The AList:(Amy-1), (Bob-2), (Eli-5), (Cal-3), (Dot-4) ) Item inserted at index 4: (Fay-6). The AList: f (Amy-1), (Bob-2), (Eli-5), (Cal-3), (Fay-6), (Dot-4) ) Testing get(index) There are 6 items in the list Item(0): (Amy-1). Item(1): (Bob-2). Item(2): (Eli-5). Item(3): (Cal-3). Item(4): (Fay-6). Item(5): (Dot-4) Items added: Gil,Hop,Kim,Lee The AList: (Amy-1), (Bob-2), (Eli-5), (Cal-3), (Fay-6), (Dot-4), (Gil-7), (Hop-8), (Kim-9), (Lee-10) There are 10 items in the list, Testing set(index, element) Set Item(4) to (Gil-7).The AList: (Amy-1), (Bob-2), (Eli-5), (Cal-3), (Gil-7), (Dot-4), (Gil-7), (Hop-8), (Kim-9), (Lee-10) ) Set Item(8) to (Hop-8).The AList: (Amy-1), (Bob-2), (Eli-5), (Cal-3), (Gil-7), (Dot-4), (Gil-7), (Hop-8), (Hop-8), (Lee-10) ) Testing contains(element) The AList contains (Dot-4) The AList does not contain (Mak-11) Testing remove(index) Removed Item(3): (Cal-3). The AList:(Amy-1), (Bob-2), (Eli-5), (Gil-7), (Dot-4), (Gil-7), (Hop-8), (Hop-8), (Lee-10) ) Removed Item(5): (Gil-7). The AList:(Amy-1), (Bob-2), (Eli-5), (Gil-7), (Dot-4), (Hop-8), (Hop-8), (Lee-10)) There are 8 items in the list. Testing remove(element) Removed item containing (Amy-1). The AList: (Bob-2), (Eli-5), (Gil-7), (Dot-4), (Hop-8), (Hop-8), (Lee-10) ) Cannot remove (Mak-11). Not in AList. Testing indexOf(element) The first occurrence of (Gil-7) is at index: 2 The AList does not contain (Mak-11) Removed Item (0): (Bob-2) The AList: (Eli-5), (Gil-7), (Dot-4), (Hop-8), (Hop-8), (Lee-10) ) Removed Item(0): (Eli-5) The AList: (Gil-7), (Dot-4), (Hop-8), (Hop-8), (Lee-10) ) Removed Item(0): (Gil-7) The AList: (Dot-4), (Hop-8), (Hop-8), (Lee-10) Removed Item(0): (Dot-4) The AList: (Hop-8), (Hop-8), (Lee-10) h Removed Item(0): (Hop-8) The AList: (Hop-8), (Lee-10) ) Removed Item(0): (Hop-8) The AList:(Lee-10) ) Removed Item(0): (Lee-10) The AList: Is the list empty? true Show transcribed image text Create an ArrayList (AList) that is an index-based List that is similar in functionality to Java’s ArrayList, except it will be based on a Node-based Doubly Linked List with Sentinels (not on arrays or ArrayLists) This AList class must extend DLL . implement AListADT use generics throughout include findNode0, the private worker method specified below: findNode0 must use the following definition: . private DLLNode findNode(int index) throws IndexOutOfBoundsException . each of the index-based methods must call findNode0, since all of them will need to find a DLLNode using an index. When your project is complete, and all provided files are part of your project, and you run the testers, the output of each of the testers should be exactly as shown in the tester output documents provided. AList.java must do all of the following · include a complete Code Header using the required format (code not accepted without this) For the output section, state whether or not your output matches the required output exactly, and, if not, what is different. Don’t paste in a copy of the output file. compile successfully using provided files with no changes (code not accepted without this) run without exceptions (code not accepted without this) include appropriate asserts include appropriate pre- and post- condition comments for most methods throw exceptions for any operation that should not take place on an emptylist throw exceptions for any operation that uses an out-of-bounds index (too high, toolow)
Testing add(element) The AList: Item added: 11. The AList: (11) Item added: 33. The AList: (11, 33 h Item added: 55. The AList: (11, 33, 55 ) Item added: 77. The AList: (11, 33, 55, 77) Testing add(index, element) Item inserted at index 2: 200. The AList: 11, 33, 200, 55, 77) Item inserted at index 4: 400. The AList: 11, 33, 200, 55, 400, 77 Testing get(index) There are 6 items in the list: Item(0): 11. Item(1): 33. Item(2): 200. Item(3): 55. Item(4): 400. Item(5): 77 Items added: 22, 44, 66, 88 The AList: 11, 33, 200, 55, 400, 77, 22, 44, 66, 88) There are 10 items in the list, Testing set(index, element) Set Item(4) to 22. The AList: (11, 33, 200, 55, 22,77, 22,44, 66, 88 Set Item(8) to 44. The AList: (11, 33, 200, 55, 22,77, 22,44, 44, 88 Testing contains(element) The AList contains 77 The AList does not contain 123 Testing remove(index) Removed Item(3): 55. The AList: 11, 33, 200, 22,77, 22, 44,44, 88 ) Removed Item(5): 22. The AList: 11, 33, 200, 22,77,44, 44, 88 ) There are 8 items in the list. Testing remove(element) Removed item containing 11. The AList:33, 200, 22,77,44, 44, 88) Cannot remove 99. Not in AList. Testing indexOf(element) The first occurrence of 44 is at index: 4 The AList does not contain 10 Reset AList elements to 0-6 The AList: 10, 1, 2, 3, 4, 5, 6) Is the list empty? false Removed Item(0): 0 The AList:1, 2, 3,4,5, 6h Removed Item(0): 1 The AList: 2, 3, 4, 5, 6) Removed Item(O): 2 The AList:3, 4, 5,6) Removed Item(0): 3 The AList: 4, 5, 6h Removed Item(O): 4 The AList: (5, 6) Removed Item(0): 5 The AList:6 Removed Item(0): 6 The AList: Is the list empty? true
Item added: (Amy-1). The AList: (Amy-1) ) Item added: (Bob-2). The AList: f (Amy-1), (Bob-2)h Item added: (Cal-3). The AList: (Amy-1), (Bob-2), (Cal-3) ) Item added: (Dot-4). The AList:(Amy-1), (Bob-2), (Cal-3), (Dot-4) ) Testing add(index, element) Item inserted at index 2: (Eli-5). The AList:(Amy-1), (Bob-2), (Eli-5), (Cal-3), (Dot-4) ) Item inserted at index 4: (Fay-6). The AList: f (Amy-1), (Bob-2), (Eli-5), (Cal-3), (Fay-6), (Dot-4) ) Testing get(index) There are 6 items in the list Item(0): (Amy-1). Item(1): (Bob-2). Item(2): (Eli-5). Item(3): (Cal-3). Item(4): (Fay-6). Item(5): (Dot-4) Items added: Gil,Hop,Kim,Lee The AList: (Amy-1), (Bob-2), (Eli-5), (Cal-3), (Fay-6), (Dot-4), (Gil-7), (Hop-8), (Kim-9), (Lee-10) There are 10 items in the list, Testing set(index, element) Set Item(4) to (Gil-7).The AList: (Amy-1), (Bob-2), (Eli-5), (Cal-3), (Gil-7), (Dot-4), (Gil-7), (Hop-8), (Kim-9), (Lee-10) ) Set Item(8) to (Hop-8).The AList: (Amy-1), (Bob-2), (Eli-5), (Cal-3), (Gil-7), (Dot-4), (Gil-7), (Hop-8), (Hop-8), (Lee-10) ) Testing contains(element) The AList contains (Dot-4) The AList does not contain (Mak-11) Testing remove(index) Removed Item(3): (Cal-3). The AList:(Amy-1), (Bob-2), (Eli-5), (Gil-7), (Dot-4), (Gil-7), (Hop-8), (Hop-8), (Lee-10) ) Removed Item(5): (Gil-7). The AList:(Amy-1), (Bob-2), (Eli-5), (Gil-7), (Dot-4), (Hop-8), (Hop-8), (Lee-10)) There are 8 items in the list. Testing remove(element) Removed item containing (Amy-1). The AList: (Bob-2), (Eli-5), (Gil-7), (Dot-4), (Hop-8), (Hop-8), (Lee-10) ) Cannot remove (Mak-11). Not in AList. Testing indexOf(element) The first occurrence of (Gil-7) is at index: 2 The AList does not contain (Mak-11) Removed Item (0): (Bob-2) The AList: (Eli-5), (Gil-7), (Dot-4), (Hop-8), (Hop-8), (Lee-10) ) Removed Item(0): (Eli-5) The AList: (Gil-7), (Dot-4), (Hop-8), (Hop-8), (Lee-10) ) Removed Item(0): (Gil-7) The AList: (Dot-4), (Hop-8), (Hop-8), (Lee-10) Removed Item(0): (Dot-4) The AList: (Hop-8), (Hop-8), (Lee-10) h Removed Item(0): (Hop-8) The AList: (Hop-8), (Lee-10) ) Removed Item(0): (Hop-8) The AList:(Lee-10) ) Removed Item(0): (Lee-10) The AList: Is the list empty? true
Expert Answer
Answer to Create an ArrayList (AList) that is an index-based List that is similar in functionality to Java’s ArrayList, except it … . . .
OR

