cz.cuni.amis.pogamut.udk.communication.translator.bot.support
Class BotListState<MESSAGE,CONTEXT extends TranslatorContext>
java.lang.Object
cz.cuni.amis.pogamut.udk.communication.translator.bot.support.AbstractBotFSMState<InfoMessage,CONTEXT>
cz.cuni.amis.pogamut.udk.communication.translator.bot.support.BotListState<MESSAGE,CONTEXT>
- Type Parameters:
MESSAGE
- CONTEXT
-
- All Implemented Interfaces:
- cz.cuni.amis.fsm.IFSMState<InfoMessage,CONTEXT>
- Direct Known Subclasses:
- ItemListState, MoverListState, MutatorListState, NavPointNeighboursState, PathAcceptState, PlayerListState, VehicleListState
public abstract class BotListState<MESSAGE,CONTEXT extends TranslatorContext>
- extends AbstractBotFSMState<InfoMessage,CONTEXT>
Support class that takes care of batch of messages in the form of:
START_MSG MSG MSG .... MSG END_MSG
Performs class checks over the symbols that are used to enter / leave the state.
Stores all the MSGs inside a list.
To use this state you have to subclass this abstract class, use correct super() inside the constructor of your class
and override stateLeaving() method (first by calling super.stateLeaving()) and use getList() to obtain the list
of all messages that came between START and END message.
- Author:
- Jimmy
BotListState
public BotListState(Class beginMessage,
Class<MESSAGE> message,
Class endMessage)
- Parameters:
beginMessage
- message class that should be used to enter this statemessage
- class of messages we should store inside the list (must be the same as generic type MESSAGE!)endMessage
- message class that should be used to leave this state
getList
protected List<MESSAGE> getList()
newList
protected void newList()
init
public void init(CONTEXT context)
restart
public void restart(CONTEXT context)
stateEntering
public void stateEntering(CONTEXT context,
cz.cuni.amis.fsm.IFSMState<InfoMessage,CONTEXT> fromState,
InfoMessage symbol)
stateLeaving
public void stateLeaving(CONTEXT context,
cz.cuni.amis.fsm.IFSMState<InfoMessage,CONTEXT> toState,
InfoMessage symbol)
stateSymbol
public void stateSymbol(CONTEXT context,
InfoMessage symbol)
Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.