Class Edge<S>

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

    public abstract class Edge<S>
    extends Object
    This class (with specialised subclasses) represents edges of automata including their acceptance membership.
    • Method Detail

      • 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.
      • acceptanceSetIterator

        public abstract PrimitiveIterator.OfInt acceptanceSetIterator()
        An iterator containing all acceptance sets this edge is a member of in ascending order.
        Returns:
        An iterator with all acceptance sets of this edge.
      • successor

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

        public abstract boolean hasAcceptanceSets()
        Returns whether this edge has any acceptance set.
      • inSet

        public abstract boolean inSet​(@Nonnegative
                                      int i)
        Test membership of this edge for a specific acceptance set.
        Parameters:
        i - The number of the acceptance set.
        Returns:
        True if this edge is a member, false otherwise.
      • largestAcceptanceSet

        public abstract int largestAcceptanceSet()
        Returns the largest acceptance set this edge is a member of, or -1 if none.
      • smallestAcceptanceSet

        public abstract int smallestAcceptanceSet()
        Returns the largest acceptance set this edge is a member of, or Integer.MAX_VALUE if none.
      • withAcceptance

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

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

        public Edge<S> withoutAcceptance()
      • withSuccessor

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