com.blackledge.david.game.crossword
Class CrosswordPuzzle.Puzzleword

java.lang.Object
  extended by com.blackledge.david.game.crossword.CrosswordPuzzle.Puzzleword
All Implemented Interfaces:
Comparable
Enclosing class:
CrosswordPuzzle

public static class CrosswordPuzzle.Puzzleword
extends Object
implements Comparable

Embodiment of an entry in a Crossword Puzzle - word, position, direction, and clue. Has natural sorting order that matches clue numbering scheme.

Version:
$Revision: 1.3 $

Constructor Summary
CrosswordPuzzle.Puzzleword(String word, String clue, boolean horizontal, int top, int left)
           
 
Method Summary
 int compareTo(Object o)
          Sort in clue order, ignoring horizontal/vertical except horizontal are listed before vertical when in the same location.
 String getClue()
           
 int getClueNumber()
           
 int getLeft()
           
 int getLength()
           
 int getTop()
           
 boolean isHorizontal()
           
 void setClue(String clue)
           
 void setClueNumber(int clueNumber)
           
 String toString()
          Presents the clue and the clue number/direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CrosswordPuzzle.Puzzleword

public CrosswordPuzzle.Puzzleword(String word,
                                  String clue,
                                  boolean horizontal,
                                  int top,
                                  int left)
Method Detail

isHorizontal

public boolean isHorizontal()

getTop

public int getTop()

getLeft

public int getLeft()

getClue

public String getClue()

setClue

public void setClue(String clue)

setClueNumber

public void setClueNumber(int clueNumber)

getClueNumber

public int getClueNumber()

compareTo

public int compareTo(Object o)
Sort in clue order, ignoring horizontal/vertical except horizontal are listed before vertical when in the same location.

Specified by:
compareTo in interface Comparable

toString

public String toString()
Presents the clue and the clue number/direction.

Overrides:
toString in class Object

getLength

public int getLength()