com.anji.tournament
Class CompositeTournament

java.lang.Object
  extended bycom.anji.tournament.CompositeTournament
All Implemented Interfaces:
Configurable, Tournament

public class CompositeTournament
extends java.lang.Object
implements Tournament, Configurable

Author:
Philip Tucker

Constructor Summary
CompositeTournament()
          default ctor; init() should be called before using this object
CompositeTournament(java.util.List aSubTourneys)
          ctor
 
Method Summary
 void addContestant(Player aContestant)
           
 void clearContestants()
          remove all contestants added via addContestant()
 int getMaxScore()
           
 int getMinScore()
           
 java.util.List getSubTournaments()
          return all sub-tournaments
 void init(Properties props)
           
 java.util.List playTournament()
          Play full tournament.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeTournament

public CompositeTournament()
default ctor; init() should be called before using this object


CompositeTournament

public CompositeTournament(java.util.List aSubTourneys)
ctor

Parameters:
aSubTourneys -
Method Detail

clearContestants

public void clearContestants()
Description copied from interface: Tournament
remove all contestants added via addContestant()

Specified by:
clearContestants in interface Tournament
See Also:
Tournament.clearContestants()

addContestant

public void addContestant(Player aContestant)
Specified by:
addContestant in interface Tournament
Parameters:
aContestant - Player to be added.
See Also:
Tournament.addContestant(com.anji.tournament.Player)

playTournament

public java.util.List playTournament()
Description copied from interface: Tournament
Play full tournament.

Specified by:
playTournament in interface Tournament
Returns:
List contains TournamentPlayerResults objects, sorted in descending order of score
See Also:
Tournament.playTournament()

getMaxScore

public int getMaxScore()
Specified by:
getMaxScore in interface Tournament
Returns:
maximum possible score a contestant can achieve in this tournament; this value may change as contestants are added; refers to TournamentPlayerResults.getTournamentScore() not TournamentPlayerResults.getScore()
See Also:
Tournament.getMaxScore()

getMinScore

public int getMinScore()
Specified by:
getMinScore in interface Tournament
Returns:
minimum possible score a contestant can achieve in this tournament; this value may change as contestants are added; refers to TournamentPlayerResults.getTournamentScore() not TournamentPlayerResults.getScore()
See Also:
Tournament.getMinScore()

init

public void init(Properties props)
          throws java.lang.Exception
Specified by:
init in interface Configurable
Parameters:
props - configuration parameters
Throws:
java.lang.Exception
See Also:
Configurable.init(com.anji.util.Properties)

getSubTournaments

public java.util.List getSubTournaments()
return all sub-tournaments

Returns:
List contains Tournament objects