All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.cola.statemachine.StateMachine Maven / Gradle / Ivy

package com.alibaba.cola.statemachine;

/**
 * StateMachine
 *
 * @author Frank Zhang
 *
 * @param  the type of state
 * @param  the type of event
 * @param  the user defined context
 * @date 2020-02-07 2:13 PM
 */
public interface StateMachine extends Visitable{

    /**
     * Send an event {@code E} to the state machine.
     *
     * @param sourceState the source state
     * @param event the event to send
     * @param ctx the user defined context
     * @return the target state
     */
     S fireEvent(S sourceState, E event, C ctx);

    /**
     * MachineId is the identifier for a State Machine
     * @return
     */
    String getMachineId();

    /**
     * Use visitor pattern to display the structure of the state machine
     */
    void showStateMachine();

    String generatePlantUML();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy