public class StateMasterModule extends cz.cuni.amis.pogamut.base.agent.module.SensorModule<USAR2004Bot>
| Modifier and Type | Field and Description |
|---|---|
protected MissionPackageModule |
packageModule |
protected static StateMasterModule |
singleton |
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.StateMasterModule.StateMessageListener |
stateListener |
protected StateContainer |
stateModule |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanUp() |
protected SuperState |
createNewState(StateMessage message)
Asks VehicleType (enum) if it knows VehicleType represented by string
type.
|
protected void |
fileMessage(StateMessage message)
Updates previous State or creates a new Record.
|
List<String> |
getAvailibleTypes()
Returns list of availible state object names.
|
MissionPackageModule |
getMissionPackageModule()
Mission package module for information about misspkgs.
|
static StateMasterModule |
getModuleInstance(USAR2004Bot bot)
Returns singleton instance of this module if it already exists.
|
List<SuperState> |
getStatesByClass(Class c)
Iterates through local hahmap values and takes note of every SuperState
object that is Instance of specified class.
|
SuperState |
getStatesByType(String type)
Gets state message representative from local hashmap.
|
SuperState |
getStatesByVehilceType(VehicleType type)
Iterates through local hashmap values and seeks match.
|
Boolean |
isReady()
Check method for making sure the acces to this module is possible.Returns
false if either state collection is empty or null;
|
protected boolean |
updateStateCollection(StateMessage message)
Returns a flag that indicates if stateUpdate was successful.
|
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.StateMasterModule.StateMessageListener stateListener
protected static StateMasterModule singleton
protected StateContainer stateModule
protected MissionPackageModule packageModule
public static StateMasterModule getModuleInstance(USAR2004Bot bot)
bot - Parameter for possible creating of new instance.public Boolean isReady()
public SuperState getStatesByType(String type)
type - String representation of state type.public SuperState getStatesByVehilceType(VehicleType type)
type - VehicleType representation of state type - easier to use
since we don't have to watch after propper spelling.public List<SuperState> getStatesByClass(Class c)
c - c is class that the state message should extend, So when
SuperState is inserted as c, it should return list of all types of
vehicles that this holds data of.public List<String> getAvailibleTypes()
protected SuperState createNewState(StateMessage message)
message - StateMessage object containing valid VehicleType.protected boolean updateStateCollection(StateMessage message)
message - new StateMessage object.protected void fileMessage(StateMessage message)
message - This ought to be StateMessage caught by listener.public MissionPackageModule getMissionPackageModule()
protected void cleanUp()
cleanUp in class cz.cuni.amis.pogamut.base.agent.module.AgentModule<USAR2004Bot>Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.