edu.columbia.cs.coms4701.agent.environments.grid
Class SimpleGridObject

java.lang.Object
  extended by edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
      extended by edu.columbia.cs.coms4701.agent.environments.grid.SimpleGridObject
All Implemented Interfaces:
EnvironmentObject, GridObject
Direct Known Subclasses:
RoombaDirt, SimpleGridObstacle, Stone

public class SimpleGridObject
extends SimpleEnvironmentObject
implements GridObject

An implementation of GridObject; just an environment object that also has a location.

Version:
0.1

User: aaron Date: Aug 25, 2006 Time: 2:24:11 PM

Author:
aaron@cs

Field Summary
 
Fields inherited from class edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
changeSupport
 
Constructor Summary
SimpleGridObject()
           
 
Method Summary
 DiscretePoint2D getLocation()
          Gets the location of the object in the grid.
 void setLocation(DiscretePoint2D theLocation)
          Sets the location of the object in the grid.
 java.lang.String toString()
           
 
Methods inherited from class edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
addPropertyChangeListener, isAlive, removePropertyChangeListener, setAlive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.columbia.cs.coms4701.agent.EnvironmentObject
addPropertyChangeListener, isAlive, removePropertyChangeListener, setAlive
 

Constructor Detail

SimpleGridObject

public SimpleGridObject()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class SimpleEnvironmentObject

getLocation

public DiscretePoint2D getLocation()
Gets the location of the object in the grid.

Specified by:
getLocation in interface GridObject
Returns:
the coordinates in the grid

setLocation

public void setLocation(DiscretePoint2D theLocation)
Sets the location of the object in the grid.

It's the environment's responsibility to ensure that newly assigned locations are within the bounds established by the environment.

Specified by:
setLocation in interface GridObject
Parameters:
theLocation - a 2-dimensional point, assumed to be valid