Summary:
In this assignment, you will comment on and use Bailey's
Vector
structure.
Note: While we have not yet learned all the issues in Java programming necessary to do this assignment, we will have covered them by the end of class on Monday. In any case, you can begin the design of the program now, and fill in the details as you learn them.
Citation: Much of this assignment is taken from Bailey's Java Structures
Collaboration: You may discuss your design with any size group. You may also work with each other on general debugging issues. However, each of you should code and turn in your own version of the assignment.
implements Cloneable
.
Note that you may have to look at the Java API or the Flanagan
book to figure this out.
Vector
structure were the documentation that appears in section 3.3,
what questions might you have about the use or meaning of the
various methods? Note that you should come up with at least one.
insertElementAt
different
from the precondition for setElementAt
?
Develop your own extension of Bailey's Vector
class
(Bailey's is referred to as structures.Vector
) that
supports the following methods. Call your new class
VectorPlus
.
setSize(int size)
which explicitly sets the size of
the vector. Note that you'll need to consider what happens if
this call increases the size of the vector.
fill(int lb, int ub, Object o)
which fills the
subvector from lb
to ub
inclusive.
swap(int firstpos, int secondpos)
which swaps the
elements at the two positions.
Begin to think about how you might write Othello
(or an interesting variant thereof) using the Matrix
class. You don't need to do any coding right now, but expect to
do so for the next assignment. You will, however, need to turn in a
list of classes that you will need (minimally, GameBoard
and Piece
classes) and the methods they will support.
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text written by Samuel A. Rebelsky.
Source text last modified Fri Sep 19 10:46:29 1997.
This page generated on Fri Sep 19 10:47:58 1997 by SamR's Site Suite.
Contact our webmaster at rebelsky@math.grin.edu