Class Maze

java.lang.Object
  extended by Maze

public class Maze
extends java.lang.Object


Field Summary
 int height
           
private  int Vcnt
           
 Vertex[] vertices
           
 int width
           
 
Constructor Summary
Maze(int width, int height)
          Initializes stuff
 
Method Summary
 void dewall(Vertex v, Vertex w)
          Connect the two given vertices
 Vertex getEnd()
           
 Vertex getStart()
           
 void insertDisj(Vertex v)
          Insert a single vertex
 void insertGraph(Vertex v, Vertex w)
          Insert a pair of connected vertices
 void reset()
          Set all vertices to unknown
 void show()
          Print the list of vertices and their connections
 boolean trace(java.util.Stack<Vertex> st, Vertex s, Vertex e)
          Find out if there is a path between the two vertex params
 int V()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Vcnt

private int Vcnt

vertices

public Vertex[] vertices

width

public int width

height

public int height
Constructor Detail

Maze

public Maze(int width,
            int height)
Initializes stuff

Parameters:
width - Width of this maze
height - Height of this maze
Method Detail

insertGraph

public void insertGraph(Vertex v,
                        Vertex w)
Insert a pair of connected vertices

Parameters:
v - Vertex a
w - Vertex b

show

public void show()
Print the list of vertices and their connections


reset

public void reset()
Set all vertices to unknown


trace

public boolean trace(java.util.Stack<Vertex> st,
                     Vertex s,
                     Vertex e)
Find out if there is a path between the two vertex params

Parameters:
st - A stack used to store the path
s - The starting vertex
e - The ending vertex
Returns:
Is there a path or isn't there?

V

public int V()
Returns:
Number of vertices in this maze

getStart

public Vertex getStart()
Returns:
The first vertex in this maze

getEnd

public Vertex getEnd()
Returns:
The last vertex in this maze

insertDisj

public void insertDisj(Vertex v)
Insert a single vertex

Parameters:
v - The vertex to be inserted

dewall

public void dewall(Vertex v,
                   Vertex w)
Connect the two given vertices

Parameters:
v -
w -