Package owl.automaton.edge
Interface Edge<S>
-
- Type Parameters:
S- The type of the (successor) state.
public interface Edge<S>This interface represents edges of automata including their acceptance membership.Do not implement this interface when you plan to use the reference implementations given by this package. Their equals and hashCode methods assume that there are no further implementations of this interface to optimise performance.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PrimitiveIterator.OfIntacceptanceSetIterator()An iterator containing all acceptance sets this edge is a member of in ascending order.booleanhasAcceptanceSets()Returns whether this edge has any acceptance set.booleaninSet(int i)Test membership of this edge for a specific acceptance set.intlargestAcceptanceSet()Returns the largest acceptance set this edge is a member of, or-1if none.static <S> Edge<S>of(S successor)Creates an edge which belongs to no acceptance set.static <S> Edge<S>of(S successor, int acceptance)Creates an edge which belongs to a single acceptance set.static <S> Edge<S>of(S successor, BitSet acceptance)Creates an edge which belongs to the specified acceptance sets.intsmallestAcceptanceSet()Returns the largest acceptance set this edge is a member of, orInteger.MAX_VALUEif none.Ssuccessor()Get the target state of the edge.default Edge<S>withAcceptance(int i)default Edge<S>withAcceptance(BitSet acceptance)default Edge<S>withAcceptance(IntUnaryOperator transformer)<T> Edge<T>withSuccessor(T successor)Returns an edge which has the same acceptance but the given state as successor.
-
-
-
Method Detail
-
of
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
successorwith no acceptance.
-
of
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
successorwith given acceptance.
-
of
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
successorwith given acceptance.
-
acceptanceSetIterator
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
S successor()
Get the target state of the edge.- Returns:
- The state the edge points to.
-
hasAcceptanceSets
boolean hasAcceptanceSets()
Returns whether this edge has any acceptance set.
-
inSet
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
int largestAcceptanceSet()
Returns the largest acceptance set this edge is a member of, or-1if none.
-
smallestAcceptanceSet
int smallestAcceptanceSet()
Returns the largest acceptance set this edge is a member of, orInteger.MAX_VALUEif none.
-
withAcceptance
default Edge<S> withAcceptance(IntUnaryOperator transformer)
-
withSuccessor
<T> Edge<T> withSuccessor(T successor)
Returns an edge which has the same acceptance but the given state as successor.
-
-