Class Edge<S>

  • Type Parameters:
    S - The type of the (successor) state.

    public abstract class Edge<S>
    extends Object
    This class represents edges of automata including their acceptance membership.
    • Constructor Detail

      • Edge

        public Edge()
    • Method Detail

      • successor

        public abstract S successor()
        Get the target state of the edge.
        Returns:
        The state the edge points to.
      • colours

        public abstract ImmutableBitSet colours()
        Colours: the acceptance sets this edge is part of.
      • of

        public static <S> Edge<S> of​(S successor)
        Creates an edge which belongs to no acceptance set.
        Type Parameters:
        S - Type of the successor.
        Parameters:
        successor - Successor of this edge.
        Returns:
        An edge leading to successor with no acceptance.
      • of

        public static <S> Edge<S> of​(S successor,
                                     @Nonnegative
                                     int acceptance)
        Creates an edge which belongs to a single acceptance set.
        Type Parameters:
        S - Type of the successor.
        Parameters:
        successor - Successor of this edge.
        acceptance - The delegate set this edge should belong to.
        Returns:
        An edge leading to successor with given acceptance.
      • of

        public static <S> Edge<S> of​(S successor,
                                     BitSet acceptance)
        Creates an edge which belongs to the specified acceptance sets.
        Type Parameters:
        S - Type of the successor.
        Parameters:
        successor - Successor of this edge.
        acceptance - The delegate sets this edge should belong to.
        Returns:
        An edge leading to successor with given acceptance.
      • of

        public static <S> Edge<S> of​(S successor,
                                     Collection<Integer> acceptance)
        Creates an edge which belongs to the specified acceptance sets.
        Type Parameters:
        S - Type of the successor.
        Parameters:
        successor - Successor of this edge.
        acceptance - The delegate sets this edge should belong to.
        Returns:
        An edge leading to successor with given acceptance.
      • of

        public static <S> Edge<S> of​(S successor,
                                     ImmutableBitSet acceptance)
        Creates an edge which belongs to the specified acceptance sets.
        Type Parameters:
        S - Type of the successor.
        Parameters:
        successor - Successor of this edge.
        acceptance - The delegate sets this edge should belong to.
        Returns:
        An edge leading to successor with given acceptance.
      • withAcceptance

        public Edge<S> withAcceptance​(int i)
      • withAcceptance

        public Edge<S> withAcceptance​(BitSet acceptance)
      • withoutAcceptance

        public Edge<S> withoutAcceptance()
      • withSuccessor

        public <T> Edge<T> withSuccessor​(T successor)
        Returns an edge which has the same acceptance but the given state as successor.
      • mapSuccessor

        public <T> Edge<T> mapSuccessor​(Function<? super S,​? extends T> mapper)