Class PuzzleWord

java.lang.Object
  extended by PuzzleWord

public class PuzzleWord
extends java.lang.Object

Word Search Puzzle Word. Represents a found word in a word search puzzle. A found word is a word, its length, and its location and direction in the puzzle.


Nested Class Summary
static class PuzzleWord.Directions
          The different orientations in which a puzzle word can be placed.
 
Field Summary
 Natural col
          The column position in the puzzle of the found word (one based)
 PuzzleWord.Directions direction
          The direction of the found word
 Natural row
          The row position in the puzzle of the found word (one based)
 java.lang.String word
          The found word
 Natural wordLength
          The number of letters in the found word
 
Constructor Summary
PuzzleWord(java.lang.String word, Natural row, Natural col, Natural wordLength, PuzzleWord.Directions direction)
          Construct a puzzle word from all the required components
 
Method Summary
 java.lang.String toString()
          Return a string representation of the PuzzleWord.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

word

public java.lang.String word
The found word


row

public Natural row
The row position in the puzzle of the found word (one based)


col

public Natural col
The column position in the puzzle of the found word (one based)


direction

public PuzzleWord.Directions direction
The direction of the found word


wordLength

public Natural wordLength
The number of letters in the found word

Constructor Detail

PuzzleWord

public PuzzleWord(java.lang.String word,
                  Natural row,
                  Natural col,
                  Natural wordLength,
                  PuzzleWord.Directions direction)
Construct a puzzle word from all the required components

Parameters:
word - the word that was found.
row - the row coordinate in the puzzle where the word is located (starting at 1)
col - the column coordinate in the puzzle where the word is located (starting at 1)
wordLength - the number of letters in the word
direction - the direction the word is oriented
Method Detail

toString

public java.lang.String toString()
Return a string representation of the PuzzleWord.

Overrides:
toString in class java.lang.Object