Package owl.automaton

Class MutableAutomatonUtil


  • public final class MutableAutomatonUtil
    extends Object
    • Method Detail

      • complete

        public static <S> Optional<S> complete​(MutableAutomaton<S,​?> automaton,
                                               S sinkState)
        Completes the automaton by adding a sink state obtained from the sinkSupplier if necessary. The sink state will be obtained, i.e. Supplier.get() called exactly once, if and only if a sink is added. This state will be returned wrapped in an Optional, if instead no state was added Optional.empty() is returned. After adding the sink state, the rejectingAcceptanceSupplier is called to construct a rejecting self-loop.
        Parameters:
        automaton - The automaton to complete.
        sinkState - A sink state.
        Returns:
        The added state or empty if none was added.