MESSAGE
- CONTEXT
- public abstract class BotListState<MESSAGE,CONTEXT extends TranslatorContext> extends AbstractBotFSMState<InfoMessage,CONTEXT>
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.
Constructor and Description |
---|
BotListState(Class beginMessage,
Class<MESSAGE> message,
Class endMessage) |
Modifier and Type | Method and Description |
---|---|
protected List<MESSAGE> |
getList() |
void |
init(CONTEXT context) |
protected void |
newList() |
void |
restart(CONTEXT context) |
void |
stateEntering(CONTEXT context,
cz.cuni.amis.fsm.IFSMState<InfoMessage,CONTEXT> fromState,
InfoMessage symbol) |
void |
stateLeaving(CONTEXT context,
cz.cuni.amis.fsm.IFSMState<InfoMessage,CONTEXT> toState,
InfoMessage symbol) |
void |
stateSymbol(CONTEXT context,
InfoMessage symbol) |
toString
public BotListState(Class beginMessage, Class<MESSAGE> message, Class endMessage)
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 stateprotected void newList()
public void init(CONTEXT context)
public void restart(CONTEXT context)
public void stateEntering(CONTEXT context, cz.cuni.amis.fsm.IFSMState<InfoMessage,CONTEXT> fromState, InfoMessage symbol)
public void stateLeaving(CONTEXT context, cz.cuni.amis.fsm.IFSMState<InfoMessage,CONTEXT> toState, InfoMessage symbol)
public void stateSymbol(CONTEXT context, InfoMessage symbol)
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.