/** * ListArray.java * An implementation of the List interface, using an array * as the underlying data structure */ public ListArray implements List { //declare neccessary variables (see page 86 of lab manual) //CONSTRUCTORS (see page 86-87 of lab manual) // ------------ implementation of methods from the list interface below their corresponding documentation ------- // /** * insert(Object newElement) * * This method inserts new object after cursor. Note * that the remaining elements in the list must be shifted * down by one element to make room */ /** * remove() * * This method removes the element at the cursor. * Note that this must shift the remaining elements * down to close the gap */ /** * replace(Object newElement) * * This method replaces the object at the cursor with the new element. * No shifting is required. */ /** * clear() * * This method removes all elements from the list. * (hint: it might be easiest just to make a new array!) */ /** * isEmpty() * * returns true if the array is empty */ /** * isFull() * * returns true if the array is full */ /** * goToBeginning() * * moves the cursor to the beginning of the array */ /** * goToEnd() * * moves cursor to the end of the array */ /** * goToNext() * * moves cursor to the next element in the list */ /** * goToPrior() * * moves cursor to the preceding element */ /** * getCursor() * * returns the Object at the current cursor */ /** * showStructure() * * Outputs the elements in the list */ }