mit.ai.techniques
Class Puzzle

java.lang.Object
  |
  +--mit.ai.techniques.Puzzle

public class Puzzle
extends java.lang.Object

This class will construct the row and column data for a Paint By Numbers problem, if given a two-dimensional array that describes the binary picture to be encoded (true == black, false == white).


Field Summary
private  java.util.Vector[] colData
           
private  java.util.Vector[] rowData
           
 
Constructor Summary
Puzzle(boolean[][] puzzleData)
          Construct the puzzle.
Puzzle(java.io.File puzzleFile)
          Construct the puzzle from a file.
 
Method Summary
private  void createColData(boolean[][] binaryImData)
          Create the row encodings.
private  void createRowData(boolean[][] binaryImData)
          Create the column encodings.
 java.util.Vector[] getColData()
          Return the column encodings.
 int getHeight()
          Get the puzzle height.
 java.util.Vector[] getRowData()
          Return the row encodings.
 int getWidth()
          Get the puzzle width.
private  void readPuzzleFile(java.io.File puzzleFile)
          Parse the puzzle file and create the puzzle.
 java.lang.String toString()
          Create a string version of the encodings for this puzzle.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

rowData

private java.util.Vector[] rowData

colData

private java.util.Vector[] colData
Constructor Detail

Puzzle

public Puzzle(boolean[][] puzzleData)
Construct the puzzle.

Puzzle

public Puzzle(java.io.File puzzleFile)
Construct the puzzle from a file.
Method Detail

getWidth

public int getWidth()
Get the puzzle width.

getHeight

public int getHeight()
Get the puzzle height.

readPuzzleFile

private void readPuzzleFile(java.io.File puzzleFile)
Parse the puzzle file and create the puzzle.

getRowData

public java.util.Vector[] getRowData()
Return the row encodings.

getColData

public java.util.Vector[] getColData()
Return the column encodings.

createRowData

private void createRowData(boolean[][] binaryImData)
Create the column encodings.

createColData

private void createColData(boolean[][] binaryImData)
Create the row encodings.

toString

public java.lang.String toString()
Create a string version of the encodings for this puzzle.
Overrides:
toString in class java.lang.Object