gamekeeper2a
Class GolfGamekeeper

java.lang.Object
  |
  +--gamekeeper2a.SimpleGamekeeper
        |
        +--gamekeeper2a.GolfGamekeeper

public class GolfGamekeeper
extends SimpleGamekeeper

A Golf game keeper is aware of the fact that: 1. A low score wins 2. Ties are possible 3. No score lower than 18 is allowed


Constructor Summary
GolfGamekeeper()
          Creates a new instance of GolfGameKeeper
 
Method Summary
protected  boolean acceptGameResults(IGameResult gresult)
          Private method to check the situation before passing it along to the superclass to accept the result.
 boolean acceptGameResults(java.lang.String gameString)
          Remember the results of a match.
 boolean acceptGameResults(java.lang.String contestant1, int contestant1Score, java.lang.String contestant2, int contestant2Score)
          Remember the results of a match.
static void main(java.lang.String[] args)
          Purely for testing.
 
Methods inherited from class gamekeeper2a.SimpleGamekeeper
acceptGameResults, acceptGameResults, findContestant, listContestantResults, listContestants, setGameResults, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GolfGamekeeper

public GolfGamekeeper()
Creates a new instance of GolfGameKeeper

Method Detail

acceptGameResults

public boolean acceptGameResults(java.lang.String gameString)
Remember the results of a match. The contestant with the SMALLER score is the winner. White space at the begining and ending of the winner or loser should be ignored. For example, "Tyler", " Tyler", and " Tyler " should all be considered the same contestant. The two contestants must not be the same (after trimming spaces).

Specified by:
acceptGameResults in class SimpleGamekeeper
Returns:
true if the results are all valid; false otherwise.

acceptGameResults

public boolean acceptGameResults(java.lang.String contestant1,
                                 int contestant1Score,
                                 java.lang.String contestant2,
                                 int contestant2Score)
Remember the results of a match. The contestant with the SMALLER score is the winner. The score must be within a legal range. White space at the begining and ending of the winner or loser should be ignored. For example, "Tyler", " Tyler", and " Tyler " should all be considered the same contestant. The two contestants must not be the same (after trimming spaces).

Specified by:
acceptGameResults in class SimpleGamekeeper
Returns:
true if the results are all valid; false otherwise.

acceptGameResults

protected boolean acceptGameResults(IGameResult gresult)
Private method to check the situation before passing it along to the superclass to accept the result.

Overrides:
acceptGameResults in class SimpleGamekeeper
Returns:
true if all is OK, false otherwise.

main

public static void main(java.lang.String[] args)
Purely for testing.

Parameters:
args - the command line arguments