net.walend.grid
Interface Grid2D

All Superinterfaces:
java.util.Collection, Grid, HasState
All Known Subinterfaces:
MutableGrid2D
All Known Implementing Classes:
AbstractArrayGrid2D, AbstractMapGrid2D, MutableArrayGrid2D, MutableMapGrid2D

public interface Grid2D
extends Grid

Grid2D is a simple two-dimensional Grid, indexed by (i,j).

Since:
20010927
Author:
David Walend dfw1@cornell.edu

Nested Class Summary
static class Grid2D.Dimensions2D
           
 
Field Summary
static Grid2D.Dimensions2D DIMENSIONS2D
           
static Dimension I
           
static Dimension J
           
 
Method Summary
 boolean containsAddress(int i, int j)
          Return true if the i,j address is on the Grid.
 java.lang.Object get(int i, int j)
          Returns the object in the grid at i,j.
 IndexedIterator iStripeIterator(int i)
          Returns an iterator accross js at i.
 IndexedIterator jStripeIterator(int j)
          Returns an iterator accross is at j.
 boolean sameGrid2DAs(Grid2D grid)
          If this has the same contents as grid in the same spots, returns true.
 int sizeI()
          Return the size of the grid in I.
 int sizeJ()
          Return the size of the grid in J.
 
Methods inherited from interface net.walend.grid.Grid
addressIterator, addressOf, containsAddress, containsDimension, get, getDimensions, getFillObject, maxAddress, stripeIterator
 
Methods inherited from interface net.walend.collection.HasState
getPrincipleInterface, sameStateAs
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

DIMENSIONS2D

public static final Grid2D.Dimensions2D DIMENSIONS2D

I

public static final Dimension I

J

public static final Dimension J
Method Detail

sizeI

public int sizeI()
Return the size of the grid in I.


sizeJ

public int sizeJ()
Return the size of the grid in J.


containsAddress

public boolean containsAddress(int i,
                               int j)
Return true if the i,j address is on the Grid.


get

public java.lang.Object get(int i,
                            int j)
                     throws OffGridException
Returns the object in the grid at i,j.

OffGridException

sameGrid2DAs

public boolean sameGrid2DAs(Grid2D grid)
If this has the same contents as grid in the same spots, returns true. Ignores the fill object.


iStripeIterator

public IndexedIterator iStripeIterator(int i)
                                throws OffGridException
Returns an iterator accross js at i.

OffGridException

jStripeIterator

public IndexedIterator jStripeIterator(int j)
                                throws OffGridException
Returns an iterator accross is at j.

OffGridException


Copyright (c) 2001, 2002, David Walend