becker.xtras.jotto
Class SampleHintWithSomeLetters

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

public class SampleHintWithSomeLetters
extends Hint

Provide a hint consisting of words that contain some of the letters specified by the user.

Author:
Byron Weber Becker

Field Summary
 
Fields inherited from class becker.xtras.jotto.Hint
DIFFICULTY, GUESSES, LETTER, LETTERS, NONE
 
Constructor Summary
SampleHintWithSomeLetters(int numLetters)
          Construct the int object.
 
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
 

Constructor Detail

SampleHintWithSomeLetters

public SampleHintWithSomeLetters(int numLetters)
Construct the int object.

Parameters:
numLetters - The minimum number of letters from the set specified by the user that must be contained in the word.
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.