edu.columbia.cs.coms4701.agent
Interface EnvironmentObject

All Known Subinterfaces:
Agent<K,P>, Counter, GridMap, GridObject, GridObstacle, RobotAgent
All Known Implementing Classes:
PenteAgent, PenteRules, PenteScorekeeper, RoombaAgent, RoombaDirt, SimpleAgent, SimpleCounter, SimpleEnvironmentObject, SimpleGridMap, SimpleGridObject, SimpleGridObstacle, Stone

public interface EnvironmentObject

An object in an environment. Should conform to JavaBean conventions, to permit listener GUIs or debuggers to trace events. i.e.

The easiest way to support listeners is via the PropertyChangeSupport class from the java.beans package. Or, just subclass the SimpleEnvironmentObject class

The environment should take care of adding property change listeners for you, so when creating new objects, the only thing you need to worry about is properly sending a notification via the changeSupport.

Version:
0.1

User: aaron Date: Aug 23, 2006 Time: 4:22:36 PM

Author:
aaron@cs

Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener theListener)
          Registers a property change listener to monitor this object.
 java.lang.Boolean isAlive()
          Indicates whether this object is still active in the environment.
 void removePropertyChangeListener(java.beans.PropertyChangeListener theListener)
          Unregisters a property change listener from monitoring this object.
 void setAlive(java.lang.Boolean isAlive)
          Setter for isAlive
 

Method Detail

addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener theListener)
Registers a property change listener to monitor this object.

Parameters:
theListener - the listener to register

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener theListener)
Unregisters a property change listener from monitoring this object.

Parameters:
theListener - the listener to remove

isAlive

java.lang.Boolean isAlive()
Indicates whether this object is still active in the environment. Should probably return true initially, and be set to false by events in the environment.

Returns:
true if the object is still active, false otherwise

setAlive

void setAlive(java.lang.Boolean isAlive)
Setter for isAlive

Parameters:
isAlive - whether the object is still active