|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectMazeTracer
public class MazeTracer
MazeTracer implements the MazeChangeListener interface and outputs a textual trace of the progress of a MazeRunner.
| Field Summary | |
|---|---|
private java.io.PrintWriter |
writer
The print writer the tracer will output its trace onto. |
| Constructor Summary | |
|---|---|
MazeTracer(java.io.PrintWriter writer)
Creates a new MazeTracer that outputs its trace onto the
PrintWriter w. |
|
| Method Summary | |
|---|---|
void |
cellStateChangeEvent(MazeCell cell)
This function prints out the state of the cell that has changed. |
protected void |
finalize()
Ensure the writer is properly closed when this object is shutdown. |
void |
stateChangeEvent()
Print outs an error if this method is called. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.io.PrintWriter writer
| Constructor Detail |
|---|
public MazeTracer(java.io.PrintWriter writer)
MazeTracer that outputs its trace onto the
PrintWriter w. Clients should in a new print writer
instance because this class will close the print writer when it finishes.
writer - A new print writer that this object can use to output its
trace onto.| Method Detail |
|---|
public void cellStateChangeEvent(MazeCell cell)
cellStateChangeEvent in interface MazeChangeListenercell - the cell whose state change is being broadcastpublic void stateChangeEvent()
stateChangeEvent in interface MazeChangeListenerprotected void finalize()
finalize in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||