protected class SAutomaton.StatePro extends java.lang.Object implements IStatePro
IStatePro.IChangeListener, IStatePro.ITransition, IStatePro.IVisitListener
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList |
changeListeners |
protected AutomatonSet_String.SState |
state |
protected Automaton.IStateChangedListener |
stateChangedListener |
protected Automaton.IStateVisitedListener |
stateVisitedListener |
protected java.util.LinkedList |
visitListeners |
Modifier | Constructor and Description |
---|---|
protected |
StatePro(AutomatonSet_String.SState state) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(IStatePro.IChangeListener listener) |
IStatePro.ITransition |
addTransition(ISet_char charSet,
IStatePro toState)
Adds a new transition to this state.
|
void |
addVisitListener(IStatePro.IVisitListener listener) |
protected void |
finalize() |
StateProSet |
getAllReachableStates()
Returns all states that are reachable from this state through it's transitions and so on.
|
IStatePro.ITransition[] |
getAllTransitions()
returns all transitions (normal and epsilon transitions) of this state.
|
IStatePro.ITransition[] |
getETransitions() |
int |
getStateNumber() |
IStatePro.ITransition[] |
getTransitions() |
boolean |
isFinal() |
protected SAutomaton |
parent() |
void |
removeAllTransitions() |
boolean |
removeChangeListener(IStatePro.IChangeListener listener) |
boolean |
removeTransition(IStatePro.ITransition transition)
Removes the specified transition from this state.
|
boolean |
removeVisitListener(IStatePro.IVisitListener listener) |
void |
setFinal(boolean isFinal)
Makes this state final or non final.
|
java.lang.String |
toString() |
IState |
visit()
Visits this state with an epsilon transition and returns its epsilon closure.
|
protected final Automaton.IStateVisitedListener stateVisitedListener
protected final Automaton.IStateChangedListener stateChangedListener
protected java.util.LinkedList visitListeners
protected java.util.LinkedList changeListeners
protected final AutomatonSet_String.SState state
protected StatePro(AutomatonSet_String.SState state)
public void addVisitListener(IStatePro.IVisitListener listener)
addVisitListener
in interface IStatePro
public boolean removeVisitListener(IStatePro.IVisitListener listener)
removeVisitListener
in interface IStatePro
public void addChangeListener(IStatePro.IChangeListener listener)
addChangeListener
in interface IStatePro
public boolean removeChangeListener(IStatePro.IChangeListener listener)
removeChangeListener
in interface IStatePro
protected void finalize()
finalize
in class java.lang.Object
protected SAutomaton parent()
public boolean isFinal()
public void setFinal(boolean isFinal)
IStatePro
public IState visit()
IStatePro
public IStatePro.ITransition addTransition(ISet_char charSet, IStatePro toState)
IStatePro
charSet
and it's destionation
state toState
, so that you can transit from this state to the destination state
only with a character contained in charSet
. There is only one exception,
if charSet
is null, an epsilon transition will be added, which means that there
are no chars needed to get to the destinationState toState
; in other words a
state that has an epsilon transition can get through this epsilon transition to the destination
state toState
without any char, so that we can say that toState
melts
into the state.addTransition
in interface IStatePro
charSet
- the characters for this transitiontoState
- the destination state where to transit topublic boolean removeTransition(IStatePro.ITransition transition)
IStatePro
removeTransition
in interface IStatePro
public void removeAllTransitions()
removeAllTransitions
in interface IStatePro
public StateProSet getAllReachableStates()
IStatePro
getAllReachableStates
in interface IStatePro
public IStatePro.ITransition[] getTransitions()
getTransitions
in interface IStatePro
public IStatePro.ITransition[] getETransitions()
getETransitions
in interface IStatePro
public IStatePro.ITransition[] getAllTransitions()
getAllTransitions
in interface IStatePro
public int getStateNumber()
getStateNumber
in interface IStatePro
public java.lang.String toString()
toString
in class java.lang.Object