de.kosi.model.tournament
Class KosiMovement

java.lang.Object
  |
  +--de.kosi.model.tournament.KosiMovement
All Implemented Interfaces:
Movement

public class KosiMovement
extends java.lang.Object
implements Movement

This is the implementation of a simple Bridge-movement. Every pair will play against each other. When the number of pairs is even every pair is playing in every round. With an odd number of pairs there will one pair be waiting in each round.

All pairs will play the same board set simultaneously.

ChangeLog:

 $Log: KosiMovement.java,v $
 Revision 1.1.1.1  2001/04/29 18:05:18  jiriki
 Imported sources from zola.

 Revision 1.8  2001/04/18 10:26:19  login
 Implemented Test-Case for movements!!

 Revision 1.7  2001/03/15 20:14:32  login
 Renamed the class Round to Match

 Revision 1.6  2001/03/12 18:16:27  login
 noch nen bug gefunden

 Revision 1.5  2001/03/12 18:07:35  login
 Bisschen am movement rumgefeilt

 Revision 1.4  2001/03/06 18:20:26  login
 documentation

 Revision 1.3  2001/03/06 18:16:32  login
 updated documentation

 Revision 1.2  2001/03/06 15:14:08  login
 - documentation


 

Version:
$Revision: 1.1.1.1 $ ($Date: 2001/04/29 18:05:18 $)
Author:
Timo, Niklas, Ole

Constructor Summary
KosiMovement(java.util.List pairs, int boardsPerRound)
          Creates a KosiMovement instance for the given list of pairs and number of boards per round.
 
Method Summary
 int getBoardsPerRound()
          Returns the number of boards that one pair will play against the same opponents.
 Match getMatch(int round, int table)
          This method calculates the match pairing of two pairs and the respective boards for the given round and table numbers.
 int getNumberOfRounds()
          Returns the number of rounds that the tournament this movement is for comprises.
 int getNumberOfTables()
          Returns the number of tables needed for this movement.
 Pair[] getWaitingPairs(int round)
          The method calculates the pairs that have a break in the given round.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KosiMovement

public KosiMovement(java.util.List pairs,
                    int boardsPerRound)
Creates a KosiMovement instance for the given list of pairs and number of boards per round.
Parameters:
pairs - The list of pairs which are paticipating in the tournament this movement is made for.
boardsPerRound - The number of boards that one pair is playing against the same opponents.
Throws:
java.lang.IllegalArgumentException - If the number of boards per round was less than 1.
Method Detail

getNumberOfTables

public int getNumberOfTables()
Returns the number of tables needed for this movement.
Specified by:
getNumberOfTables in interface Movement
Returns:
The number of tables needed for this movement.

getNumberOfRounds

public int getNumberOfRounds()
Returns the number of rounds that the tournament this movement is for comprises. The number of games that one pair has to play can be calculated in this way: getNumberOfRounds() * getBoardsPerRound().
Specified by:
getNumberOfRounds in interface Movement
Returns:
The number of rounds of the tournament this movement is for.

getBoardsPerRound

public int getBoardsPerRound()
Returns the number of boards that one pair will play against the same opponents. The number of games that one pair has to play can be calculated in this way: getNumberOfRounds() * getBoardsPerRound().
Specified by:
getBoardsPerRound in interface Movement
Returns:
The number of boards per round.

getMatch

public Match getMatch(int round,
                      int table)
This method calculates the match pairing of two pairs and the respective boards for the given round and table numbers.
Specified by:
getMatch in interface Movement
Parameters:
round - The number of the round the pairings are calculated for. Range must be within 1 to getNumberOfRounds().
table - The number of the table the pairings are calculated for. Range must be within 1 to getNumberOfTables().
Returns:
The wanted pairing and board set.
Throws:
java.lang.IllegalArgumentException - If round or table number are out of range.

getWaitingPairs

public Pair[] getWaitingPairs(int round)
The method calculates the pairs that have a break in the given round.
Specified by:
getWaitingPairs in interface Movement
Parameters:
round - The number of the round of that the waiting pairs are to be calculated.
Returns:
An array of waiting pairs. If no pair is waiting, an array of length zero will be returned. The array entries may never be null.
Throws:
java.lang.IllegalArgumentException - If round or table number are out of range.