For this homework, download the BasicList
, BasicListIterator
, and BasicArrayList
Java files from the course web, and make the following modifications to them.
Your code should not only work properly, but it also should be high-quality. In particular:
addAll
to interface BasicList
and
class BasicArrayList
. Method
addAll
should have a single parameter of type BasicList
,
and should add all of the elements from that list to the current list, in
the order
that they appear in the other list. The other list should not be modified.hasPrevious
, previous
,
and remove
in class BasicArrayListIterator
(which
is a nested class in BasicArrayList
).
Method remove
should throw an IllegalStateException
if
appropriate - including if it is called before any call to next
or previous
,
or called more than once after a call to next
or previous
.
See the JavaDoc pages for the standard Iterator
and ListIterator
classes
for details of how these methods should work and when exceptions should be
thrown.BasicArrayList
and BasicArrayListIterator
so
that a ConcurrentModificationException
is thrown when an
iterator method is called and the underlying list has been modified since
the iterator object was created. To simplify things you may assume that
only one iterator is created at a time - i.e., you do not need to handle
the case where an element is
removed by one iterator while another iterator is active.Turn in your assignment online using the turnin form linked from the course web site (when available). You should include
BasicList
, BasicListIterator
, and BasicArrayList
,
including your modifications