net.walend.grid
Class MutableArrayGrid2D

java.lang.Object
  |
  +--net.walend.grid.AbstractArrayGrid2D
        |
        +--net.walend.grid.MutableArrayGrid2D
All Implemented Interfaces:
java.util.Collection, Grid, Grid2D, HasState, MutableGrid, MutableGrid2D, java.io.Serializable

public class MutableArrayGrid2D
extends AbstractArrayGrid2D
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

Nested Class Summary
 
Nested classes inherited from class net.walend.grid.AbstractArrayGrid2D
 
Nested classes inherited from class net.walend.grid.Grid2D
Grid2D.Dimensions2D
 
Field Summary
 
Fields inherited from class net.walend.grid.AbstractArrayGrid2D
 
Fields inherited from interface net.walend.grid.Grid2D
DIMENSIONS2D, I, J
 
Constructor Summary
MutableArrayGrid2D(Address2D maxAddress)
           
MutableArrayGrid2D(Address2D maxAddress, Grid2D grid)
           
MutableArrayGrid2D(Address2D maxAddress, java.lang.Object fill)
           
MutableArrayGrid2D(Grid2D grid)
           
MutableArrayGrid2D(int sizeI, int sizeJ)
           
MutableArrayGrid2D(int sizeI, int sizeJ, Grid2D grid)
           
MutableArrayGrid2D(int sizeI, int sizeJ, java.lang.Object fill)
           
 
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.AbstractArrayGrid2D
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 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
 
Methods inherited from interface net.walend.grid.Grid2D
containsAddress, get, iStripeIterator, jStripeIterator, sameGrid2DAs, sizeI, sizeJ
 

Constructor Detail

MutableArrayGrid2D

public MutableArrayGrid2D(int sizeI,
                          int sizeJ,
                          java.lang.Object fill)
                   throws OffGridException

MutableArrayGrid2D

public MutableArrayGrid2D(int sizeI,
                          int sizeJ)
                   throws OffGridException

MutableArrayGrid2D

public MutableArrayGrid2D(Address2D maxAddress)
                   throws OffGridException

MutableArrayGrid2D

public MutableArrayGrid2D(Address2D maxAddress,
                          java.lang.Object fill)
                   throws OffGridException

MutableArrayGrid2D

public MutableArrayGrid2D(Grid2D grid)
                   throws OffGridException

MutableArrayGrid2D

public MutableArrayGrid2D(Address2D maxAddress,
                          Grid2D grid)
                   throws OffGridException

MutableArrayGrid2D

public MutableArrayGrid2D(int sizeI,
                          int sizeJ,
                          Grid2D grid)
                   throws OffGridException
Method Detail

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 AbstractArrayGrid2D
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 AbstractArrayGrid2D
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 AbstractArrayGrid2D
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 AbstractArrayGrid2D
Returns:
the object that was at i,j.


Copyright (c) 2001, 2002, David Walend