public class NFATransitionSet extends Object implements TransitionSet, Iterable<NFAStateTransition>
NFAStateTransition inside this class is defined by its target NFAState as
returned by NFAStateTransition.getTarget(boolean), where
NFATransitionSet.isForward() is used as the parameter forward.
NFATransitionSet.iterator() reflects insertion order.DFAGenerator,
DFAStateTransitionBuilder| Modifier and Type | Method and Description |
|---|---|
void |
add(NFAStateTransition transition)
Add a
NFAStateTransition to this set. |
void |
addAll(TransitionSet other)
Add all transitions contained in the given transition set.
|
static NFATransitionSet |
create(NFA nfa,
boolean forward,
NFAStateTransition transition) |
NFATransitionSet |
createMerged(TransitionSet other)
Create a merged set of
this and other by copying this and adding the
contents of other to the copy. |
boolean |
equals(Object obj)
Checks if the set is equal to another given set.
|
NFAStateSet |
getTargetStateSet() |
int |
hashCode()
Returns the hash code value for this set.
|
boolean |
isEmpty() |
boolean |
isForward() |
Iterator<NFAStateTransition> |
iterator()
Returns an iterator that will yield the elements contained in this set in insertion
order.
|
boolean |
leadsToFinalState()
Returns
true if the set contains a transition to a NFA state that in turn contains a
transition to an un-anchored NFA final state as denoted by
NFAState.hasTransitionToUnAnchoredFinalState(boolean), where NFATransitionSet.isForward() is
used as the forward parameter. |
int |
size() |
Stream<NFAStateTransition> |
stream()
Returns a stream that will yield the elements contained in this set in insertion
order.
|
JsonValue |
toJson() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static NFATransitionSet create(NFA nfa, boolean forward, NFAStateTransition transition)
public NFATransitionSet createMerged(TransitionSet other)
TransitionSetthis and other by copying this and adding the
contents of other to the copy.createMerged in interface TransitionSetother - the TransitionSet to be merged with the copy. Implementing classes may
accept objects of their own type only.this!public boolean isForward()
public boolean leadsToFinalState()
true if the set contains a transition to a NFA state that in turn contains a
transition to an un-anchored NFA final state as denoted by
NFAState.hasTransitionToUnAnchoredFinalState(boolean), where NFATransitionSet.isForward() is
used as the forward parameter.public boolean isEmpty()
public int size()
public NFAStateSet getTargetStateSet()
public void add(NFAStateTransition transition)
NFAStateTransition to this set. Note that this set will refuse to add the
transition if it already contains a transition leading to the same target state as
denoted by NFAStateTransition.getTarget(boolean), where NFATransitionSet.isForward() is used
as the forward parameter.public void addAll(TransitionSet other)
addAll in interface TransitionSetother - the TransitionSet to be merged with this. Implementing classes
may accept objects of their own type only.NFATransitionSet.add(NFAStateTransition)public int hashCode()
NFAStateSet containing all target
states of the transitions in this transition set.hashCode in interface TransitionSethashCode in class Objectpublic boolean equals(Object obj)
NFATransitionSets and have the same set of target states (as returned by
NFAStateTransition.getTarget(boolean)).equals in interface TransitionSetequals in class Objectpublic Iterator<NFAStateTransition> iterator()
iterator in interface Iterable<NFAStateTransition>public Stream<NFAStateTransition> stream()
public JsonValue toJson()
toJson in interface JsonConvertible