edu.kzoo.grid
Class ArrayListGrid

java.lang.Object
  |
  +--edu.kzoo.grid.ArrayListGrid

public class ArrayListGrid
extends java.lang.Object

Grid Container Package:
The ArrayListGrid class encapsulates two public inner classes that extend the Grid class to model a two-dimensional grid by keeping track of their contents in ArrayList objects. The first public inner class, ArrayListGrid.Bounded, represents a bounded grid using an ArrayList, while the second public inner class, ArrayListGrid.Unbounded, represents an unbounded grid using an ArrayList.

Methods of both ArrayListGrid classes have the following time and space characteristics:
numObjectsO(1)
allObjectsO(n)
isEmpty, objectAtO(n)
addO(1) [amortized]
removeO(n)
spaceO(n)
where n is the number of objects in the grid.

The ArrayListGrid classes are based on the College Board's UnboundedEnv class, as allowed by the GNU General Public License.

Version:
20 March 2004
Author:
Alyce Brady
See Also:
Direction, Location, GridObject

Nested Class Summary
static class ArrayListGrid.ArrayListGridRep
          Internal representation for an ArrayList-based implementation of a Grid class.
static class ArrayListGrid.Bounded
          An ArrayListGrid.Bounded object is a rectangular, bounded two-dimensional container data structure implemented as an ArrayList of the objects it contains.
static class ArrayListGrid.Unbounded
          An ArrayListGrid.Unounded object is an unbounded two-dimensional container data structure implemented as an ArrayList of the objects it contains.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait