dasher
Class CWrapperFactory

java.lang.Object
  extended by dasher.CModuleFactory
      extended by dasher.CWrapperFactory

public class CWrapperFactory
extends CModuleFactory

A simple ModuleFactory which simply wraps a pre-existing DasherModule and returns it as the sole module it can produce.


Field Summary
protected  int m_iCurrentPos
          Index of the next module to retrieve
protected  CDasherModule m_Module
          Module wrapped by this factory
 
Constructor Summary
CWrapperFactory(CEventHandler EventHandler, CSettingsStore SettingsStore, CDasherModule Module)
          Creates a new WrapperFactory wrapping a specified Module.
 
Method Summary
 void DestroyFactory()
          Unref's our module and deletes its reference.
 CDasherModule GetModule(long iID)
          Returns our wrapped module if the ID is correct, or null otherwise.
 java.lang.String GetName(long iID)
          Returns our wrapped module's name if the ID is correct, or "Not implemented" otherwise.
 SFactoryInfo GetNext(SFactoryInfo info)
          Returns the details of our module with the name "Unknown Module" if this is the first call made to this method, or a copy of the SFactoryInfo fed in if not.
 int GetType(long iID)
          Returns our wrapped module's type if the ID is correct, or 0 otherwise.
 boolean IsMore()
          Returns true if no Modules have been retrieved yet
 void Start()
          Sets m_iCurrentPost to 0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Module

protected CDasherModule m_Module
Module wrapped by this factory


m_iCurrentPos

protected int m_iCurrentPos
Index of the next module to retrieve

Constructor Detail

CWrapperFactory

public CWrapperFactory(CEventHandler EventHandler,
                       CSettingsStore SettingsStore,
                       CDasherModule Module)
Creates a new WrapperFactory wrapping a specified Module.

Parameters:
EventHandler - EventHandler with which to register ourselves
SettingsStore - Settings repository to use
Module - Module to wrap
Method Detail

DestroyFactory

public void DestroyFactory()
Unref's our module and deletes its reference.


Start

public void Start()
Sets m_iCurrentPost to 0

Specified by:
Start in class CModuleFactory

IsMore

public boolean IsMore()
Returns true if no Modules have been retrieved yet

Specified by:
IsMore in class CModuleFactory
Returns:
True if so, false otherwise

GetNext

public SFactoryInfo GetNext(SFactoryInfo info)
Returns the details of our module with the name "Unknown Module" if this is the first call made to this method, or a copy of the SFactoryInfo fed in if not.

Specified by:
GetNext in class CModuleFactory
Parameters:
info - Previous module details
Returns:
Next module details

GetModule

public CDasherModule GetModule(long iID)
Returns our wrapped module if the ID is correct, or null otherwise.

Specified by:
GetModule in class CModuleFactory
Parameters:
iID - UID of the required module
Returns:
Corresponding module, or null if no module belonging to this factory has this ID.

GetName

public java.lang.String GetName(long iID)
Returns our wrapped module's name if the ID is correct, or "Not implemented" otherwise.

Specified by:
GetName in class CModuleFactory
Parameters:
iID - UID of the requested module
Returns:
Name of the requested module, or "Not Implemented" if there is no such module

GetType

public int GetType(long iID)
Returns our wrapped module's type if the ID is correct, or 0 otherwise.

Specified by:
GetType in class CModuleFactory
Parameters:
iID - UID of the requested module
Returns:
Type of the given module, or 0 if there is no such module