becker.xtras.jotto
Class SampleHintWithoutLetter
java.lang.Object
becker.xtras.jotto.Hint
becker.xtras.jotto.SampleHintWithoutLetter
- All Implemented Interfaces:
- IWordPredicate
public final class SampleHintWithoutLetter
- extends Hint
Provide a hint consisting of words that do not contain the letter
specified by the user.
- Author:
- Byron Weber Becker
Field Summary |
protected char |
letter
|
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. |
static void |
main(String[] args)
Test the class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
letter
protected char letter
SampleHintWithoutLetter
public SampleHintWithoutLetter()
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.
main
public static void main(String[] args)
- Test the class.
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.