becker.xtras.jotto
Class MatchCount

java.lang.Object
  extended by becker.xtras.jotto.MatchCount
Direct Known Subclasses:
Guess

public class MatchCount
extends Object

MatchCount objects report how many exact and partial matches are contained in a pair of words. It is used by IGuessEvaluator so that a single method can return "multiple" values.

Author:
Byron Weber Becker

Constructor Summary
MatchCount(int numExact, int numPartial)
          Construct a new MatchCount object to report the number of exact and partial matches in two words.
 
Method Summary
 int getExact()
          Get the number of exact matches between the two words.
 int getPartial()
          Get the number of partial matches between the two words.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchCount

public MatchCount(int numExact,
                  int numPartial)
Construct a new MatchCount object to report the number of exact and partial matches in two words.

Parameters:
numExact - The number of exact matches. (0 <= numExact <= JottoModel.NUM_LETTERS) and (numExact + numPartial <= JottoModel.NUM_LETTERS)
numPartial - The number of partial matches. (0 <= numPartial <= JottoModel.NUM_LETTERS)
Method Detail

getExact

public int getExact()
Get the number of exact matches between the two words.

Returns:
the number of exact matches

getPartial

public int getPartial()
Get the number of partial matches between the two words.

Returns:
the number of partial matches