Package owl.automaton.edge
Class Edge<S>
- java.lang.Object
-
- owl.automaton.edge.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 Summary
Constructors Constructor Description Edge()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ImmutableBitSet
colours()
Colours: the acceptance sets this edge is part of.Edge<S>
mapAcceptance(IntUnaryOperator transformer)
<T> Edge<T>
mapSuccessor(Function<? super S,? extends T> mapper)
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.static <S> Edge<S>
of(S successor, Collection<Integer> acceptance)
Creates an edge which belongs to the specified acceptance sets.static <S> Edge<S>
of(S successor, ImmutableBitSet acceptance)
Creates an edge which belongs to the specified acceptance sets.abstract S
successor()
Get the target state of the edge.String
toString()
Edge<S>
withAcceptance(int i)
Edge<S>
withAcceptance(BitSet acceptance)
Edge<S>
withAcceptance(ImmutableBitSet acceptance)
Edge<S>
withoutAcceptance()
<T> Edge<T>
withSuccessor(T successor)
Returns an edge which has the same acceptance but the given state as successor.
-
-
-
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(ImmutableBitSet acceptance)
-
mapAcceptance
public Edge<S> mapAcceptance(IntUnaryOperator transformer)
-
withSuccessor
public <T> Edge<T> withSuccessor(T successor)
Returns an edge which has the same acceptance but the given state as successor.
-
-