Class Maze.MazeFactory

java.lang.Object
  extended by Maze.MazeFactory
Enclosing class:
Maze

public static class Maze.MazeFactory
extends java.lang.Object

MazeFactory is a Factory Design Pattern that generates a new Maze. It should throw a malformed input exception, but I didn't have time to go through and fix that. It currently exits if it hits a parse error.

Author:
Albert J. Wong

Constructor Summary
Maze.MazeFactory()
           
 
Method Summary
(package private) static Maze parseMaze(java.lang.String filename)
          parseMaze takes a file in and tries to generate a Maze from that file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Maze.MazeFactory

public Maze.MazeFactory()
Method Detail

parseMaze

static Maze parseMaze(java.lang.String filename)
               throws java.io.FileNotFoundException,
                      java.io.IOException
parseMaze takes a file in and tries to generate a Maze from that file.

Parameters:
filename - Name of file with data to generate a Maze.
Returns:
Returns a new Maze based on the given filename.
Throws:
java.io.FileNotFoundException - Thrown if the file cannot be found.
java.io.IOException - Thrown on a generic IO Exception