Class ConcurrentFSM<E,​F extends FSM<E>>

  • Type Parameters:
    E - THe type of event that the FSM will be able to process.

    public class ConcurrentFSM<E,​F extends FSM<E>>
    extends FSM<E>
    A concurrent FSM: an FSM that contains multiple FSMs that run concurrently.
    • Constructor Detail

      • ConcurrentFSM

        public ConcurrentFSM​(Set<F> fsms)
        Creates the FSM
        Parameters:
        fsms - The concurrent FSMs.
        Throws:
        IllegalArgumentException - If the number of FSMs is lower than 2.
    • Method Detail

      • getConccurFSMs

        public List<F> getConccurFSMs()
        Returns:
        All the FSMs in an unmodifiable list.
      • process

        public boolean process​(E event)
        Description copied from class: FSM
        Processes the provided event to run the FSM.
        Overrides:
        process in class FSM<E>
        Parameters:
        event - The event to process.
        Returns:
        True: the FSM correctly processed the event.
      • isStarted

        public boolean isStarted()
        Overrides:
        isStarted in class FSM<E>
        Returns:
        True: The FSM started.
      • log

        public void log​(boolean log)
        Description copied from class: FSM
        Logs (or not) information about the execution of the FSM.
        Overrides:
        log in class FSM<E>
        Parameters:
        log - True: logging activated.
      • uninstall

        public void uninstall()
        Description copied from class: FSM
        Uninstall the FSM. Useful for flushing memory. The FSM must not be used after that.
        Overrides:
        uninstall in class FSM<E>