dasher
Class CModuleManager

java.lang.Object
  extended by dasher.CModuleManager

public class CModuleManager
extends java.lang.Object

Helper class for the InterfaceBase which enumerates the modules present in supplied module factories and returns said modules by ID or by name on request.

A list of all available modules can also be supplied.


Field Summary
protected  java.util.HashMap<java.lang.Long,CModuleFactory> m_mapModules
          Map from modules' IDs to the modules themselves
 
Constructor Summary
CModuleManager()
           
 
Method Summary
 CDasherModule GetModule(long iID)
          Gets a module with the given identifier
 CDasherModule GetModuleByName(java.lang.String strName)
          Retrieves a module by name.
 void ListModules(int iType, java.util.Collection<java.lang.String> vList)
          Retrieves a list of all modules with a given type.
 void RegisterFactory(CModuleFactory Factory)
          Enumerates all modules provided by a given factory and stores them in our internal map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_mapModules

protected java.util.HashMap<java.lang.Long,CModuleFactory> m_mapModules
Map from modules' IDs to the modules themselves

Constructor Detail

CModuleManager

public CModuleManager()
Method Detail

RegisterFactory

public void RegisterFactory(CModuleFactory Factory)
Enumerates all modules provided by a given factory and stores them in our internal map.

These modules can henceforth be retrieved using GetModuleByName or GetModule.

Parameters:
Factory - Factory to search for new modules

GetModule

public CDasherModule GetModule(long iID)
Gets a module with the given identifier

Parameters:
iID - ID of the required module
Returns:
Matching Module, or null if none was found.

GetModuleByName

public CDasherModule GetModuleByName(java.lang.String strName)
Retrieves a module by name. The module must previously have been registered using RegisterFactory.

Parameters:
strName - Name of the requested module
Returns:
Module with this name, or null if there is none.

ListModules

public void ListModules(int iType,
                        java.util.Collection<java.lang.String> vList)
Retrieves a list of all modules with a given type.

Available types:

0 - Input device

1 - Input filter

Parameters:
iType - Type of modules to enumerate
vList - Collection to be filled with the names of available modules