model
Class TournamentManager

java.lang.Object
  extended by model.TournamentManager

public class TournamentManager
extends java.lang.Object

Class is used to manage the tournaments in the program and to provide an interface for the user interface. This is a static class.


Nested Class Summary
private static class TournamentManager.DataFileFilter
           
 
Field Summary
private static java.util.HashMap<ID,Tournament> closed_tournaments
           
private static java.util.HashMap<ID,Tournament> open_tournaments
           
 
Constructor Summary
TournamentManager()
           
 
Method Summary
static Tournament addTournament(Tournament new_tournament)
          Creates a new tournament data file and adds tournament header information to the tournament list file (tournaments.xml) (tournament id number and filename are generated automatically)
static void closeTournament(ID tournament_id)
           
static void deleteEntry(ID tournament_id, ID entry_id)
           
static void deleteTournament(ID tournament_id)
           
static Tournament getClosedTournament(ID tournament_id)
          Returns a closed tournament with the given tournament id number.
static Tournament[] getClosedTournaments()
           
static EntryInitializer getEntryInitializer(ID tournament_id)
           
static EntryUpdater getEntryUpdater(ID tournament_id, ID entry_id)
           
static Tournament getOpenTournament(ID tournament_id)
          Returns an open tournament with the given tournament id number.
static Tournament[] getOpenTournaments()
           
static EntryInitializer getPreEntryInitializer(ID tournament_id)
           
static EntryUpdater getPreEntryUpdater(ID tournament_id, ID entry_id)
           
static Tournament getTournament(ID tournament_id)
           
static TournamentInitializer getTournamentInitializer()
          Returns a TournamentInitializer object that can be used to create a new tournament.
static TournamentUpdater getTournamentUpdater(ID tournament_id)
           
static void readTournamentDataFromDisk()
          Reads the tournament data files from the data folder.
static void reopenTournament(ID tournament_id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

open_tournaments

private static java.util.HashMap<ID,Tournament> open_tournaments

closed_tournaments

private static java.util.HashMap<ID,Tournament> closed_tournaments
Constructor Detail

TournamentManager

public TournamentManager()
Method Detail

readTournamentDataFromDisk

public static void readTournamentDataFromDisk()
                                       throws GoException
Reads the tournament data files from the data folder. Throws an exception with the pathnames of the files that cannot be read.

Throws:
GoException - thrown if the there are problems reading the data files

getTournamentInitializer

public static TournamentInitializer getTournamentInitializer()
                                                      throws GoException
Returns a TournamentInitializer object that can be used to create a new tournament.

Returns:
tournament initializer
Throws:
GoException

getTournamentUpdater

public static TournamentUpdater getTournamentUpdater(ID tournament_id)
                                              throws GoException
Throws:
GoException

getEntryInitializer

public static EntryInitializer getEntryInitializer(ID tournament_id)
                                            throws GoException
Throws:
GoException

getPreEntryInitializer

public static EntryInitializer getPreEntryInitializer(ID tournament_id)
                                               throws GoException
Throws:
GoException

getEntryUpdater

public static EntryUpdater getEntryUpdater(ID tournament_id,
                                           ID entry_id)
                                    throws GoException
Throws:
GoException

getPreEntryUpdater

public static EntryUpdater getPreEntryUpdater(ID tournament_id,
                                              ID entry_id)
                                       throws GoException
Throws:
GoException

deleteEntry

public static void deleteEntry(ID tournament_id,
                               ID entry_id)
                        throws TournamentNotFoundException,
                               EntryNotFoundException,
                               GoIOException
Throws:
TournamentNotFoundException
EntryNotFoundException
GoIOException

closeTournament

public static void closeTournament(ID tournament_id)
                            throws TournamentNotFoundException,
                                   GoIOException
Throws:
TournamentNotFoundException
GoIOException

reopenTournament

public static void reopenTournament(ID tournament_id)
                             throws TournamentNotFoundException,
                                    GoIOException
Throws:
TournamentNotFoundException
GoIOException

deleteTournament

public static void deleteTournament(ID tournament_id)
                             throws GoException
Throws:
GoException

addTournament

public static Tournament addTournament(Tournament new_tournament)
                                throws GoException
Creates a new tournament data file and adds tournament header information to the tournament list file (tournaments.xml) (tournament id number and filename are generated automatically)

Throws:
GoException

getTournament

public static Tournament getTournament(ID tournament_id)
                                throws TournamentNotFoundException
Throws:
TournamentNotFoundException

getOpenTournament

public static Tournament getOpenTournament(ID tournament_id)
                                    throws TournamentNotFoundException
Returns an open tournament with the given tournament id number.

Throws:
TournamentNotFoundException

getClosedTournament

public static Tournament getClosedTournament(ID tournament_id)
                                      throws TournamentNotFoundException
Returns a closed tournament with the given tournament id number.

Throws:
TournamentNotFoundException

getOpenTournaments

public static Tournament[] getOpenTournaments()

getClosedTournaments

public static Tournament[] getClosedTournaments()