|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
cz.cuni.amis.pogamut.base.agent.module.SensorModule<USAR2004Bot>
cz.cuni.amis.pogamut.usar2004.agent.module.master.StateMasterModule
public class StateMasterModule
Master module for gathering every state message server sends. They are saved respectively by their type and than name. There is a listener for STA messages that updates data in StateContainer. There is also Mission package module because STA and MISSTA messages are both State messages. All mastermodules are singletons.
| Field Summary | |
|---|---|
protected MissionPackageModule |
packageModule
|
protected static StateMasterModule |
singleton
|
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.StateMasterModule.StateMessageListener |
stateListener
|
protected StateContainer |
stateModule
|
| Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule |
|---|
worldView |
| Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
|---|
agent, controller, eventBus, log |
| Constructor Summary | |
|---|---|
StateMasterModule(USAR2004Bot bot)
Private ctor |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
|---|
getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.StateMasterModule.StateMessageListener stateListener
protected static StateMasterModule singleton
protected StateContainer stateModule
protected MissionPackageModule packageModule
| Constructor Detail |
|---|
public StateMasterModule(USAR2004Bot bot)
bot - USAR2004Bot variable for creating instance of each new record
in stateModules(due to inheritance)| Method Detail |
|---|
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>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||