Betty v1.1.0

christophedelory.betty.model.rank
Class GeneralHighestScoreRankProcessor

java.lang.Object
  extended by christophedelory.betty.model.rank.GeneralHighestScoreRankProcessor
All Implemented Interfaces:
RankProcessor, Comparator<PlayerRank>

public class GeneralHighestScoreRankProcessor
extends Object
implements RankProcessor, Comparator<PlayerRank>

A rank processor which scope is the full list of players in a phase, and based on the player scores.

Version:
$Revision$
Author:
Christophe Delory

Constructor Summary
GeneralHighestScoreRankProcessor()
           
 
Method Summary
 int compare(PlayerRank o1, PlayerRank o2)
           
 void processPhasePlayerRanks(LocalPhase dbPhase, Collection<LocalEvent> dbEvents, int initialRank, List<PlayerRank> playerRanksToBeResolved)
          In the scope of the specified phase, assigns the ranks to the list of players, starting at initialRank.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

GeneralHighestScoreRankProcessor

public GeneralHighestScoreRankProcessor()
Method Detail

processPhasePlayerRanks

public void processPhasePlayerRanks(LocalPhase dbPhase,
                                    Collection<LocalEvent> dbEvents,
                                    int initialRank,
                                    List<PlayerRank> playerRanksToBeResolved)
                             throws Exception
Description copied from interface: RankProcessor
In the scope of the specified phase, assigns the ranks to the list of players, starting at initialRank.

Specified by:
processPhasePlayerRanks in interface RankProcessor
Parameters:
dbPhase - a championship's phase. Shall not be null.
dbEvents - the list of phase's events. Shall not be null.
initialRank - the associated rank. Should be greater or equal to 1.
playerRanksToBeResolved - a list of player ranks which shall be tuned. Should not be null.
Throws:
NullPointerException - if dbPhase is null.
IllegalArgumentException - if initialRank is lower than 1.
Exception - if any unexpected error occurs.

compare

public int compare(PlayerRank o1,
                   PlayerRank o2)
Specified by:
compare in interface Comparator<PlayerRank>

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.