java.lang.Object PuzzleWord
public class PuzzleWord
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 |
---|
public java.lang.String word
public Natural row
public Natural col
public PuzzleWord.Directions direction
public Natural wordLength
Constructor Detail |
---|
public PuzzleWord(java.lang.String word, Natural row, Natural col, Natural wordLength, PuzzleWord.Directions direction)
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 worddirection
- the direction the word is orientedMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object