becker.xtras.jotto
Class SampleHintContainsLetter

java.lang.Object
  extended by becker.xtras.jotto.Hint
      extended by becker.xtras.jotto.SampleHintContainsLetter
All Implemented Interfaces:
IWordPredicate

public final class SampleHintContainsLetter
extends Hint

Provide a hint consisting of all the words that contain a letter specified by the user.

Author:
Byron Weber Becker

Field Summary
protected  char letter
           
 
Fields inherited from class becker.xtras.jotto.Hint
DIFFICULTY, GUESSES, LETTER, LETTERS, NONE
 
Constructor Summary
SampleHintContainsLetter()
           
 
Method Summary
 Word[] getHintWords(int maxDesired, IHintData hintData)
          Get the words to display as the hint.
 boolean isOK(Word w)
          Override this method to specify whether or not the Word w is an acceptable answer for this hint.
 
Methods inherited from class becker.xtras.jotto.Hint
getArgumentType, getDescription, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

letter

protected char letter
Constructor Detail

SampleHintContainsLetter

public SampleHintContainsLetter()
Method Detail

isOK

public boolean isOK(Word w)
Description copied from class: Hint
Override this method to specify whether or not the Word w is an acceptable answer for this hint.

Specified by:
isOK in interface IWordPredicate
Specified by:
isOK in class Hint
Parameters:
w - The word to test.
Returns:
true if the word should be included in the hint's answer; false otherwise.

getHintWords

public Word[] getHintWords(int maxDesired,
                           IHintData hintData)
Description copied from class: Hint
Get the words to display as the hint.

Specified by:
getHintWords in class Hint
Returns:
the words in the list of known words that satisfies the isOK method.