edu.memphis.ccrg.lida.workspace.structurebuildingcodelets
Class StructureBuildingCodeletModule

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
      extended by edu.memphis.ccrg.lida.workspace.structurebuildingcodelets.StructureBuildingCodeletModule
All Implemented Interfaces:
FrameworkModule, FullyInitializable, Initializable, CodeletManagerModule

public class StructureBuildingCodeletModule
extends FrameworkModuleImpl
implements CodeletManagerModule

A module which maintains Codelets of workspace. This module manages Codelets and responds for sending events to framework GUI.

Author:
Ryan J McCall

Field Summary
 
Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
taskSpawner
 
Constructor Summary
StructureBuildingCodeletModule()
          Default Constructor.
 
Method Summary
 void addCodelet(Codelet cod)
          Adds specified Codelet to this module to be run.
 void decayModule(long ticks)
          Decay only this Module.
 StructureBuildingCodelet getCodelet(java.lang.String codeletType)
          Returns a new Codelet of the specified type or null if this type is not supported.
 StructureBuildingCodelet getCodelet(java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> params)
          Returns a new Codelet of the specified type or null if this type is not supported.
 StructureBuildingCodelet getDefaultCodelet()
          Returns a new Codelet of the default type of the Manager
 StructureBuildingCodelet getDefaultCodelet(java.util.Map<java.lang.String,java.lang.Object> params)
          Returns a new Codelet of the default type of the Manager
 java.lang.Object getModuleContent(java.lang.Object... params)
          Intended to be called from the GUI.
 void init()
          Will set parameters with the following names:

sbcModule.defaultCodeletType
sbcModule.codeletActivation
sbcModule.codeletRemovalThreshold
 void setAssociatedModule(FrameworkModule module, java.lang.String moduleUsage)
          Sets an associated FrameworkModule.
 void setDefaultCodeletType(java.lang.String type)
          Sets default codelet type used by this Manager.
 java.lang.String toString()
           
 
Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
addListener, addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getParam, getSubmodule, getSubmodule, getSubmodules, init, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.FrameworkModule
addListener, addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable
getParam, init
 

Constructor Detail

StructureBuildingCodeletModule

public StructureBuildingCodeletModule()
Default Constructor. Sets up the initial default StructureBuildingCodelet for the module.

Method Detail

init

public void init()
Will set parameters with the following names:

sbcModule.defaultCodeletType
sbcModule.codeletActivation
sbcModule.codeletRemovalThreshold

Specified by:
init in interface Initializable
Overrides:
init in class FrameworkModuleImpl
See Also:
FrameworkModuleImpl.init()

setDefaultCodeletType

public void setDefaultCodeletType(java.lang.String type)
Description copied from interface: CodeletManagerModule
Sets default codelet type used by this Manager.

Specified by:
setDefaultCodeletType in interface CodeletManagerModule
Parameters:
type - type name of codelet in the ElementFactory
See Also:
ElementFactory

setAssociatedModule

public void setAssociatedModule(FrameworkModule module,
                                java.lang.String moduleUsage)
Description copied from interface: FullyInitializable
Sets an associated FrameworkModule.

Specified by:
setAssociatedModule in interface FullyInitializable
Overrides:
setAssociatedModule in class FrameworkModuleImpl
Parameters:
module - the module to be associated.
moduleUsage - how module will be used @see ModuleUsage

getDefaultCodelet

public StructureBuildingCodelet getDefaultCodelet()
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the default type of the Manager

Specified by:
getDefaultCodelet in interface CodeletManagerModule
Returns:
new default Codelet

getDefaultCodelet

public StructureBuildingCodelet getDefaultCodelet(java.util.Map<java.lang.String,java.lang.Object> params)
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the default type of the Manager

Specified by:
getDefaultCodelet in interface CodeletManagerModule
Parameters:
params - Optional parameters or null
Returns:
new default Codelet

getCodelet

public StructureBuildingCodelet getCodelet(java.lang.String codeletType)
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the specified type or null if this type is not supported.

Specified by:
getCodelet in interface CodeletManagerModule
Parameters:
codeletType - Codelet type
Returns:
new Codelet of specified type or null if type is not supported
See Also:
ElementFactory

getCodelet

public StructureBuildingCodelet getCodelet(java.lang.String type,
                                           java.util.Map<java.lang.String,java.lang.Object> params)
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the specified type or null if this type is not supported.

Specified by:
getCodelet in interface CodeletManagerModule
Parameters:
type - Codelet type
params - Optional parameters or null
Returns:
new Codelet of specified type or null if type is not supported

addCodelet

public void addCodelet(Codelet cod)
Description copied from interface: CodeletManagerModule
Adds specified Codelet to this module to be run.

Specified by:
addCodelet in interface CodeletManagerModule
Parameters:
cod - Codelet to be added to run

toString

public java.lang.String toString()
Overrides:
toString in class FrameworkModuleImpl

getModuleContent

public java.lang.Object getModuleContent(java.lang.Object... params)
Description copied from class: FrameworkModuleImpl
Intended to be called from the GUI. Override this method to return particular module content based on params.

Specified by:
getModuleContent in interface FrameworkModule
Overrides:
getModuleContent in class FrameworkModuleImpl
Parameters:
params - - specifies what content will be returned.
Returns:
various kinds of content of this module.

decayModule

public void decayModule(long ticks)
Description copied from interface: FrameworkModule
Decay only this Module.

Specified by:
decayModule in interface FrameworkModule
Parameters:
ticks - number of ticks to decay.