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

org.squirrelframework.foundation.fsm.StateContext Maven / Gradle / Ivy

Go to download

foundation module of squirrel framework which provided event driven infrastructure and a finite state machine implementation.

There is a newer version: 0.3.10
Show newest version
package org.squirrelframework.foundation.fsm;

import java.util.List;

/**
 * Then context of state machine when processing any events
 * 
 * @author Henry.He
 *
 * @param  state machine type
 * @param  state type
 * @param  event type
 * @param  context type
 */
public interface StateContext, S, E, C> {
    
	/**
	 * @return current state machine object
	 */
    MutableStateMachine getStateMachine();
    
    /**
     * @return source state of state machine
     */
    ImmutableState getSourceState();
    
    /**
     * @return external context object
     */
    C getContext();
    
    /**
     * @return event 
     */
    E getEvent();
    
    /**
     * Search state machine active child state store and return last active child state of parent state
     * @param parentState parent state
     * @return last active child state of parent state
     */
    ImmutableState getLastActiveChildStateOf(ImmutableState parentState);
    
    /**
     * Update state machine active child state store
     * @param parentState parent state
     * @param childState last active child state
     */
    void setLastActiveChildState(ImmutableState parentState, ImmutableState childState);
    
    /**
     * @param parentState parent state
     * @return sub-states of parent parallel stae
     */
    List> getSubStatesOn(ImmutableState parentState);
    
    /**
     * @return transition result
     */
    TransitionResult getResult();
    
    /**
     * @return action executor
     */
    ActionExecutor getExecutor();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy