Class MP4

java.lang.Object
  extended by MP4

public class MP4
extends java.lang.Object

MP4 is a sliding block puzzle solver. It coordinates solving the puzzle by instantiating PuzzleLoader and PuzzleSolution and handling the writing of output to the console and HTML file. TODO Learn how to use Java unit tests

Version:
2005-10-30, JDK 1.5.0.5, Eclipse 3.1.0, Windows XP, CS 340, Fall 2005, Instructor: Pat Troy, TA: Nitin Jindal
Author:
Michael Leonhard (mleonhar)

Field Summary
private static java.lang.String USAGE_TEXT
           
 
Constructor Summary
MP4()
           
 
Method Summary
static void dprint(java.lang.String string)
          Prints the string to stdout (commented out in production version)
static void main(java.lang.String[] argv)
          This method is called when the class is loaded from the command line.
static void print(java.lang.String string)
          Prints the message to stdout
private static void printFinalReport(PuzzleSolution solution)
          Prints out information about the solution (or lack of one)
private static void printInitialReport(PuzzleLoader loader)
          Prints out the results of the file load operation.
private static void writeHtmlReport(PuzzleLoader loader, PuzzleSolution solution)
          Writes a formatted HTML report with the results of the puzzle load and solution search operations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USAGE_TEXT

private static final java.lang.String USAGE_TEXT
See Also:
Constant Field Values
Constructor Detail

MP4

public MP4()
Method Detail

dprint

public static void dprint(java.lang.String string)
Prints the string to stdout (commented out in production version)

Parameters:
string - the string to be printed

print

public static void print(java.lang.String string)
Prints the message to stdout

Parameters:
string - the string to be printed

main

public static void main(java.lang.String[] argv)
This method is called when the class is loaded from the command line. It processes command line parameters, instantiates PuzzleLoader and PuzzleSolver, and handles reporting on the console.

Parameters:
argv - command line parameters

writeHtmlReport

private static void writeHtmlReport(PuzzleLoader loader,
                                    PuzzleSolution solution)
Writes a formatted HTML report with the results of the puzzle load and solution search operations. The report is written to a file named FNAME.html where FNAME is the String that was passed to the loader.

Parameters:
loader - the loaded file information
solution - the solution to the puzzle, or null

printFinalReport

private static void printFinalReport(PuzzleSolution solution)
Prints out information about the solution (or lack of one)

Parameters:
solution - the solution to the puzzle, or null

printInitialReport

private static void printInitialReport(PuzzleLoader loader)
Prints out the results of the file load operation.

Parameters:
loader - the loaded file information