|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.framework.ModuleCreator
This class creates the modules that are required in order for a specific Module implementation to be able to run. The algorithm is as follows: the ModuleCreator object is initialized with a module name. Instantiate the module represented by that name, and get the module types that it requires. Verify that it is only dependent on module types that preceed it in the ordered list of module types. For each of those module types, get the module name configured to be used for those module types and implement them. Continue this process until all dependencies have been processed. It is a runtime exception if either a module is declared to be dependent on a module type which does not proceed it, or if any module is not eventually dependent on Board, because in that case, the module is never reached.
Field Summary | |
private HashMap |
modules
The name is a ModuleName object, and the value a Module object. |
Constructor Summary | |
protected |
ModuleCreator(GameId id,
Mode mode)
For the given mode, instantiate the MoveGenerator module and all dependent modules. |
protected |
ModuleCreator(GameId id,
ModuleName topName,
Mode mode)
For the given module, instantiate it and all dependent modules. |
Method Summary | |
protected HashMap |
getModules()
Return the modules member variable produced by the constructor. |
private void |
processModules(GameId id,
ModuleName topName,
Mode mode)
Determine which modules are used by this game and instantiate them. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private HashMap modules
Constructor Detail |
protected ModuleCreator(GameId id, Mode mode) throws InternalErrorException
id
- The id of the game.mode
- The mode of the game.
InternalErrorException
- Thrown if any dependencies are not correct.protected ModuleCreator(GameId id, ModuleName topName, Mode mode) throws InternalErrorException
id
- The id of the game.mode
- The mode of the game.
InternalErrorException
- Thrown if any dependencies are not correct.Method Detail |
private void processModules(GameId id, ModuleName topName, Mode mode) throws InternalErrorException
id
- The id of the game.mode
- The mode of the game.
InternalErrorException
- Thrown if any dependencies are not correct.protected HashMap getModules()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |