Package owl.automaton

## Class MutableAutomatonUtil

- java.lang.Object
- - owl.automaton.MutableAutomatonUtil

-     public final class MutableAutomatonUtil
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `MutableAutomatonUtil.Sink` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static <S,​A extends OmegaAcceptance> MutableAutomaton<S,​A>` | `asMutable​(Automaton<S,​A> automaton)` |
    `static <S,​A extends OmegaAcceptance> MutableAutomaton<S,​A>` | `castMutable​(Object automaton, Class<S> stateClass, Class<A> acceptanceClass)` |
    `static Optional<Object>` | `complete​(MutableAutomaton<Object,​?> automaton)` |
    `static <S> Optional<S>` | `complete​(MutableAutomaton<S,​?> automaton, S sinkState)` | Completes the automaton by adding a sink state obtained from the `sinkSupplier` if necessary.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### castMutable

          public static <S,​A extends OmegaAcceptance> MutableAutomaton<S,​A> castMutable​(Object automaton,
                                                                                                    Class<S> stateClass,
                                                                                                    Class<A> acceptanceClass)

    - #### asMutable

          public static <S,​A extends OmegaAcceptance> MutableAutomaton<S,​A> asMutable​(Automaton<S,​A> automaton)

    - #### complete

          public static Optional<Object> complete​(MutableAutomaton<Object,​?> automaton)

    - #### 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.