net.walend.grid
Class MutableMapGrid2D
java.lang.Object
|
+--net.walend.grid.AbstractMapGrid2D
|
+--net.walend.grid.MutableMapGrid2D
- All Implemented Interfaces:
- java.util.Collection, Grid, Grid2D, HasState, MutableGrid, MutableGrid2D, java.io.Serializable
- public class MutableMapGrid2D
- extends AbstractMapGrid2D
- implements MutableGrid2D, java.io.Serializable
MutableGrid2D is a simple two-dimensional Grid that you can put and take.
- Author:
- David Walend dfw1@cornell.edu
- See Also:
- Serialized Form
Constructor Summary |
MutableMapGrid2D(Address2D maxAddress)
|
MutableMapGrid2D(Address2D maxAddress,
Grid2D grid)
|
MutableMapGrid2D(Address2D maxAddress,
java.lang.Object fill)
|
MutableMapGrid2D(Grid2D grid)
|
MutableMapGrid2D(int sizeI,
int sizeJ)
|
MutableMapGrid2D(int sizeI,
int sizeJ,
Grid2D grid)
|
MutableMapGrid2D(int sizeI,
int sizeJ,
java.lang.Object fill)
|
MutableMapGrid2D(int sizeI,
int sizeJ,
java.lang.Object fill,
int mapSize)
|
Method Summary |
java.lang.Object |
put(Address address,
java.lang.Object object)
Replace the Object at address with object. |
java.lang.Object |
put(int i,
int j,
java.lang.Object object)
Replaces the object at i,j with object. |
java.lang.Object |
take(Address address)
Replace the Object at Address with fill. |
java.lang.Object |
take(int i,
int j)
Replaces the object at i,j with fill. |
Methods inherited from class net.walend.grid.AbstractMapGrid2D |
add, addAll, addressIterator, addressOf, checkAddress, clear, contains, containsAddress, containsAddress, containsAll, containsDimension, get, get, getDimensions, getFillObject, getPrincipleInterface, isEmpty, iStripeIterator, iterator, jStripeIterator, maxAddress, remove, removeAll, retainAll, sameGrid2DAs, sameStateAs, size, sizeI, sizeJ, stripeIterator, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
MutableMapGrid2D
public MutableMapGrid2D(int sizeI,
int sizeJ,
java.lang.Object fill,
int mapSize)
throws OffGridException
MutableMapGrid2D
public MutableMapGrid2D(int sizeI,
int sizeJ,
java.lang.Object fill)
throws OffGridException
MutableMapGrid2D
public MutableMapGrid2D(int sizeI,
int sizeJ)
throws OffGridException
MutableMapGrid2D
public MutableMapGrid2D(Address2D maxAddress)
throws OffGridException
MutableMapGrid2D
public MutableMapGrid2D(Address2D maxAddress,
java.lang.Object fill)
throws OffGridException
MutableMapGrid2D
public MutableMapGrid2D(Grid2D grid)
throws OffGridException
MutableMapGrid2D
public MutableMapGrid2D(Address2D maxAddress,
Grid2D grid)
throws OffGridException
MutableMapGrid2D
public MutableMapGrid2D(int sizeI,
int sizeJ,
Grid2D grid)
throws OffGridException
put
public java.lang.Object put(Address address,
java.lang.Object object)
throws OffGridException
- Replace the Object at address with object.
- Specified by:
put
in interface MutableGrid
- Overrides:
put
in class AbstractMapGrid2D
- Returns:
- the Object that was at Address.
OffGridException
take
public java.lang.Object take(Address address)
throws OffGridException
- Replace the Object at Address with fill.
- Specified by:
take
in interface MutableGrid
- Overrides:
take
in class AbstractMapGrid2D
- Returns:
- the Object that was at Address.
OffGridException
take
public java.lang.Object take(int i,
int j)
throws OffGridException
- Replaces the object at i,j with fill.
- Specified by:
take
in interface MutableGrid2D
- Overrides:
take
in class AbstractMapGrid2D
- Returns:
- the object that was at i,j.
OffGridException
put
public java.lang.Object put(int i,
int j,
java.lang.Object object)
- Replaces the object at i,j with object.
- Specified by:
put
in interface MutableGrid2D
- Overrides:
put
in class AbstractMapGrid2D
- Returns:
- the object that was at i,j.
Copyright (c) 2001, 2002, David Walend