Package com.chillycheesy.modulo.modules
Class ModuleManager
java.lang.Object
com.chillycheesy.modulo.modules.ModuleManager
Contains and manages all the
Module of HomeTracker-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsModule(Module module)Check if a module is currently in the managerbooleancontainsModule(Class<? extends Module> moduleClass)Works likecontainsModule(Module)andcontainsModule(String)but by passing the class of the modulebooleancontainsModule(String name)Works likecontainsModule(Module)but by passing the name of the moduleWorks likegetModule(String)but by passing the class of the moduleGet a module using the name of the moduleintGet the number of module currently managed by the managerGet the started modules.voidvoidstopModule(Module module)It stops a module, removes it from theModuleManagervoidstopModules(List<Module> modules)
-
Constructor Details
-
ModuleManager
public ModuleManager()
-
-
Method Details
-
getModule
Get a module using the name of the module- Parameters:
name- name of the module you want to get- Returns:
- the module having the name passed in parameters
- Throws:
HTModuleNotFoundException- if the module you want is not int the modules manager
-
getModule
Works likegetModule(String)but by passing the class of the module- Parameters:
moduleClass- class of the wanted module- Returns:
- the module being from the class passed in parameter
- Throws:
HTModuleNotFoundException- if the module you want is not int the modules manager
-
containsModule
Check if a module is currently in the manager- Parameters:
module- module you want to check- Returns:
- true if the manager contains the module, false if it doesn't
-
containsModule
Works likecontainsModule(Module)but by passing the name of the module- Parameters:
name- name of the module you want to check- Returns:
- true if the manager contains a module with this name, false if it doesn't
-
containsModule
Works likecontainsModule(Module)andcontainsModule(String)but by passing the class of the module- Parameters:
moduleClass- class of the module- Returns:
- true if the manager contains a module of this class, false if it doesn't
-
stopAllModules
public void stopAllModules() -
stopModules
- Parameters:
modules- modules you want to stop
-
stopModule
It stops a module, removes it from theModuleManager- Parameters:
module- module you want to stop
-
getModuleCount
public int getModuleCount()Get the number of module currently managed by the manager- Returns:
- the number of module
-
getModulesCopy
Get the started modules.- Returns:
- a copy of started modules.
-