becker.xtras.jotto
Class SampleGuessEvaluator

java.lang.Object
  extended by becker.xtras.jotto.SampleGuessEvaluator
All Implemented Interfaces:
IGuessEvaluator

public final class SampleGuessEvaluator
extends Object
implements IGuessEvaluator

A sample implementation of the guess evaluator. Students may write their own version to use in Jotto by implementing IGuessEvaluator.

Author:
Byron Weber Becker

Constructor Summary
SampleGuessEvaluator()
          Construct a guess evaluator object
 
Method Summary
 MatchCount countMatches(String word1, String word2)
          Count the number of exact and partial matches in a pair of words.
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
 

Constructor Detail

SampleGuessEvaluator

public SampleGuessEvaluator()
Construct a guess evaluator object

Method Detail

countMatches

public MatchCount countMatches(String word1,
                               String word2)
Description copied from interface: IGuessEvaluator
Count the number of exact and partial matches in a pair of words.

Specified by:
countMatches in interface IGuessEvaluator
Parameters:
word1 - one of the words to compare
word2 - the other word to compare
Returns:
an object containing the number of exact and partial matches

main

public static void main(String[] args)
Test the class.