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

rinde.sim.util.fsm.AbstractState Maven / Gradle / Ivy

There is a newer version: 4.4.6
Show newest version
/**
 * 
 */
package rinde.sim.util.fsm;

/**
 * Default empty implementation of state. Subclasses only need to implement the
 * {@link AbstractState#handle(Object, Object)} method.
 * @param  The event type, see {@link StateMachine} for more information.
 * @param  The context type, see {@link StateMachine} for more information.
 * @author Rinde van Lon 
 */
public abstract class AbstractState implements State {

    @Override
    public String name() {
        return getClass().getName();
    }

    @Override
    public abstract E handle(E event, C context);

    @Override
    public void onEntry(E event, C context) {}

    @Override
    public void onExit(E event, C context) {}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy