toolbus
Class State
java.lang.Object
toolbus.State
public class State
- extends java.lang.Object
class State represents one state in the state diagram of a process. It consists of StateElements
Constructor Summary |
State()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
elements
private final java.util.List<StateElement> elements
cache
private final java.util.IdentityHashMap<StateElement,java.lang.Boolean> cache
nElements
private int nElements
lastElement
private int lastElement
allAtoms
private boolean allAtoms
State
public State()
addElement
public void addElement(StateElement a)
delElement
public void delElement(StateElement a)
union
public State union(State b)
getElementsAsList
public java.util.List<StateElement> getElementsAsList()
size
public int size()
setTest
public void setTest(aterm.ATerm test,
Environment env)
throws ToolBusException
- Throws:
ToolBusException
isEnabled
public boolean isEnabled()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
contains
public boolean contains(StateElement a)
gotoNextStateAndActivate
public State gotoNextStateAndActivate()
gotoNextStateAndActivate
public State gotoNextStateAndActivate(StateElement a)
activate
public void activate()
execute
public boolean execute()
throws ToolBusException
- Execute one step for an element in this state.
- Throws:
ToolBusException
debugExecute
public toolbus.process.debug.ExecutionResult debugExecute()
throws ToolBusException
- Executes one step in debug mode and returns the executed state element as result.
- Returns:
- The result of the execution (if contains the state element and partners); null if
none was executed.
- Throws:
ToolBusException
- Thrown if something went wrong.
getLastExecutedStateElement
public StateElement getLastExecutedStateElement()
- Returns the last executed state element in the current state.
(This method is used for debugging only).
- Returns:
- The last executed state element in the current state.
getUnhandledMessages
public java.util.List<StateElement> getUnhandledMessages()