|
SMC 6_0_1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.smc.model.SmcElement
net.sf.smc.model.SmcTransition
public final class SmcTransition
SMC breaks transitions into two components: this class and
guard
. This is done because
a transition may appear multiple times in a state with
different conditional guards. The only requirement is that
the transition use the same name and parameters. Two
transitions with the name name but different parameters is
considered to be different transitions.
SmcState
,
SmcGuard
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.smc.model.SmcElement |
---|
SmcElement.TransType |
Field Summary |
---|
Fields inherited from class net.sf.smc.model.SmcElement |
---|
_lineNumber, _name, NIL_STATE |
Constructor Summary | |
---|---|
SmcTransition(java.lang.String name,
java.util.List<SmcParameter> parameters,
int lineNumber,
SmcState state)
Creates a transitions instance with the given name, parameters, line number and owning state. |
Method Summary | |
---|---|
void |
accept(SmcVisitor visitor)
Calls the visitor's visit method for this finite state machine element. |
void |
addGuard(SmcGuard guard)
Adds a guard to the list. |
int |
compareTo(SmcTransition trans)
Returns an interger value <, equal to or > than zero if this transition is <, = or > than
trans . |
int |
compareTo(java.lang.String name,
java.util.List<SmcParameter> parameters)
Returns an interger value <, equal to or > than zero if this transition's name and parameters are
<, = or > than name and parameters . |
boolean |
equals(java.lang.Object obj)
Returns true if obj is a non-null
transition instance with the same name and parameters;
false otherwise. |
java.util.List<SmcGuard> |
getGuards()
Returns the guard list. |
java.util.List<SmcParameter> |
getParameters()
Returns the transition parameters. |
SmcState |
getState()
Returns the transitions owning state. |
boolean |
hasCtxtReference()
Returns true if this transition references the
ctxt local variable and false otherwise. |
boolean |
hasNonNilEndState()
Returns true if this transition has a guard with a
non-nil end state and false otherwise. |
java.lang.String |
toString()
Returns the transition text representation. |
Methods inherited from class net.sf.smc.model.SmcElement |
---|
getLineNumber, getName, merge |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SmcTransition(java.lang.String name, java.util.List<SmcParameter> parameters, int lineNumber, SmcState state)
name
- transition name.parameters
- transition parameters.lineNumber
- where this transition appears in the .sm
file.state
- transition appears in this state.Method Detail |
---|
public void accept(SmcVisitor visitor)
accept
in class SmcElement
visitor
- The visitor instance.SmcVisitor
public int compareTo(SmcTransition trans) throws java.lang.ClassCastException
this
transition is <, = or > than
trans
. This compararison is based on the
transition name first and, if equal, then on the
parameters.
compareTo
in interface java.lang.Comparable<SmcTransition>
trans
- the compared transition instance.
this
transition is <, = or > than
trans
.
java.lang.ClassCastException
public SmcState getState()
public java.util.List<SmcParameter> getParameters()
public java.util.List<SmcGuard> getGuards()
public boolean hasCtxtReference()
true
if this transition references the
ctxt
local variable and false
otherwise.
true
if this transition references the
ctxt
local variable and false
otherwise.public boolean hasNonNilEndState()
true
if this transition has a guard with a
non-nil
end state and false
otherwise.
true
if this transition has a guard with a
non-nil
end state and false
otherwise.public void addGuard(SmcGuard guard)
guard
- add this guard.public boolean equals(java.lang.Object obj)
true
if obj
is a non-null
transition instance with the same name and parameters;
false
otherwise.
equals
in class java.lang.Object
obj
- the compared object.
true
if obj
is a non-null
transition instance with the same name and parameters;
false
otherwise.public int compareTo(java.lang.String name, java.util.List<SmcParameter> parameters)
this
transition's name and parameters are
<, = or > than name
and parameters
.
name
- transition name.parameters
- transition parameters.
this
transition's name and parameters are
<, = or > than name
and parameters
.public java.lang.String toString()
toString
in class java.lang.Object
|
SMC 6_0_1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |