Package HAL.Tools.Modularity
Class ModuleSetManager<baseModule>
- java.lang.Object
-
- HAL.Tools.Modularity.ModuleSetManager<baseModule>
-
public class ModuleSetManager<baseModule> extends java.lang.Objectthe ModuleSetManager class is used to store and use module objects. the type argument is the baseclass module type that the ModuleSetManager will manage
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.Class<baseModule>baseClassjava.util.ArrayList<java.lang.String>methodNamesjava.util.HashMap<java.lang.String,java.util.ArrayList<baseModule>>moduleListsjava.util.ArrayList<baseModule>modules
-
Constructor Summary
Constructors Constructor Description ModuleSetManager(java.lang.Class<baseModule> baseClass)the module base class object should define all of the method hooks that modules can use, the behavior of the base class object will be ignored
-
Method Summary
Modifier and Type Method Description voidAddModule(baseModule newMod)adds a module to the ModuleSetManager.intCountModsWithMethod(java.lang.String methodName)java.lang.Iterable<baseModule>Iter(java.lang.String methodName)use with foreach loop to iterate over modules that override a given method.
-
-
-
Field Detail
-
baseClass
public java.lang.Class<baseModule> baseClass
-
moduleLists
public java.util.HashMap<java.lang.String,java.util.ArrayList<baseModule>> moduleLists
-
methodNames
public java.util.ArrayList<java.lang.String> methodNames
-
modules
public java.util.ArrayList<baseModule> modules
-
-
Constructor Detail
-
ModuleSetManager
public ModuleSetManager(java.lang.Class<baseModule> baseClass)
the module base class object should define all of the method hooks that modules can use, the behavior of the base class object will be ignored
-
-
Method Detail
-
AddModule
public void AddModule(baseModule newMod)
adds a module to the ModuleSetManager. the module should override any functions in the baseClass that the will be used with the model
-
Iter
public java.lang.Iterable<baseModule> Iter(java.lang.String methodName)
use with foreach loop to iterate over modules that override a given method. used to run the module functions when appropriate
-
CountModsWithMethod
public int CountModsWithMethod(java.lang.String methodName)
-
-