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.OfInt
acceptanceSetIterator()
An iterator containing all acceptance sets this edge is a member of in ascending order.boolean
hasAcceptanceSets()
Returns whether this edge has any acceptance set.boolean
inSet(int i)
Test membership of this edge for a specific acceptance set.int
largestAcceptanceSet()
Returns the largest acceptance set this edge is a member of, or-1
if 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.int
smallestAcceptanceSet()
Returns the largest acceptance set this edge is a member of, orInteger.MAX_VALUE
if none.S
successor()
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
successor
with 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
successor
with 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
successor
with 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-1
if none.
-
smallestAcceptanceSet
int smallestAcceptanceSet()
Returns the largest acceptance set this edge is a member of, orInteger.MAX_VALUE
if 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.
-
-