|
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.SmcFSM
public final class SmcFSM
The top-level element for a finite state machine model. Contains the global state machine data:
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 | |
---|---|
SmcFSM(java.lang.String name,
java.lang.String sourceFile)
Creates a finite state machine of the given name. |
Method Summary | |
---|---|
void |
accept(SmcVisitor visitor)
Calls the visitor's visit method for this finite state machine element. |
void |
addDeclare(java.lang.String name)
Adds a forward declaration name. |
void |
addImport(java.lang.String name)
Adds an import to the list. |
void |
addInclude(java.lang.String includeFile)
Adds an include file name to the list. |
void |
addMap(SmcMap map)
Adds a state machine map to the list. |
void |
dump(java.io.PrintStream stream)
Writes this state machine configuration to the given stream. |
SmcMap |
findMap(java.lang.String name)
Returns the named map. |
java.lang.String |
getAccessLevel()
Returns the generated FSM class access level. |
java.lang.String |
getContext()
Returns the context class name. |
java.util.List<java.lang.String> |
getDeclarations()
Returns the forward declarations list. |
int |
getDeclareCount()
Returns the number of forward declarations. |
java.lang.String |
getFsmClassName()
Returns the fsm class name. |
java.lang.String |
getHeader()
Returns the context class header file name. |
int |
getHeaderLine()
Returns the current .sm header line being processed. |
int |
getImportCount()
Returns the number of imports. |
java.util.List<java.lang.String> |
getImports()
Returns the imported package and/or class list. |
java.util.List<java.lang.String> |
getIncludes()
Returns the included header file list. |
java.util.List<SmcMap> |
getMaps()
Returns the map list. |
java.lang.String |
getPackage()
Returns the package/namespace name. |
java.lang.String |
getSource()
Returns the raw %{, %} source code. |
java.lang.String |
getSourceFileName()
Returns the source file name. |
java.lang.String |
getStartState()
Returns the start state name. |
java.util.List<SmcTransition> |
getTransitions()
Returns the list of all known transitions for all maps. |
boolean |
hasEntryActions()
|
boolean |
hasExitActions()
Returns true if there is at least one state in the
state machine which has an exit action; false
otherwise. |
void |
setAccessLevel(java.lang.String accessLevel)
Sets the FSM class access level. |
void |
setContext(java.lang.String context)
Set sthe context class name. |
void |
setFsmClassName(java.lang.String fsmName)
Set sthe fsm class name and source file name. |
void |
setHeader(java.lang.String header)
Sets the context class header file name. |
void |
setHeaderLine(int lineNumber)
Set the .sm source file line being processed. |
void |
setPackage(java.lang.String pkg)
Sets the package/namespace name. |
void |
setSource(java.lang.String source)
Sets the raw source to be placed at the start of the generated target code source file. |
void |
setStartState(java.lang.String state)
Sets the FSM start state name. |
Methods inherited from class net.sf.smc.model.SmcElement |
---|
getLineNumber, getName, merge |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SmcFSM(java.lang.String name, java.lang.String sourceFile)
name
- The finite state machine name.Method Detail |
---|
public void accept(SmcVisitor visitor)
accept
in class SmcElement
visitor
- The visitor instance.SmcVisitor
public java.lang.String getSource()
public int getHeaderLine()
public java.lang.String getStartState()
public java.lang.String getContext()
public java.lang.String getSourceFileName()
public java.lang.String getFsmClassName()
public java.lang.String getHeader()
public java.util.List<java.lang.String> getIncludes()
public java.lang.String getPackage()
public java.util.List<java.lang.String> getImports()
public int getImportCount()
public int getDeclareCount()
public java.util.List<java.lang.String> getDeclarations()
public java.lang.String getAccessLevel()
public SmcMap findMap(java.lang.String name)
null
.
public java.util.List<SmcMap> getMaps()
public java.util.List<SmcTransition> getTransitions()
public boolean hasEntryActions()
public boolean hasExitActions()
true
if there is at least one state in the
state machine which has an exit action; false
otherwise.
true
if there is at least one state in the
state machine which has an exit action; false
otherwise.public void setSource(java.lang.String source)
source
- the raw target source code.public void setHeaderLine(int lineNumber)
lineNumber
- the .sm source file line.public void setStartState(java.lang.String state)
state
- start state name.public void setContext(java.lang.String context)
context
- class name.public void setFsmClassName(java.lang.String fsmName)
fsmName
- The finite state machine's class name.public void setHeader(java.lang.String header)
header
- header file name.public void addInclude(java.lang.String includeFile)
includeFile
- an include file name.public void setPackage(java.lang.String pkg)
pkg
- package/namespace name.public void addImport(java.lang.String name)
name
- an imported name.public void addDeclare(java.lang.String name)
name
- a forward declared name.public void setAccessLevel(java.lang.String accessLevel)
accessLevel
- a Java and or C# access level.public void addMap(SmcMap map)
map
- a finite state machine map.public void dump(java.io.PrintStream stream)
stream
- write this state machine to this stream.
|
SMC 6_0_1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |