All Packages Class Hierarchy This Package Previous Next Index
Class oplan.acp3.ProcessModel
java.lang.Object
|
+----oplan.acp3.ProcessModel
- public class ProcessModel
- extends Object
- implements WatcherListener, StatusValues
A ProcessModel contains a model of a process and handles the propagation
of state changes. There are a number of interior classes so that the
whole thing can be contained in one file and can avoid name conflicts
with other parts of ACP3 (e.g. for class names such as "Node").
A ProcessModel receives information from a Watcher and is therefore
an implementation of WatcherListener. It sends information to an
implementation of ProcessViewer.
Before you can do anything very interesting, you have to install a
viewer and read in a process definition. For example:
ProcessModel model = new ProcessModel();
model.setViewer(someViewer);
model.initFromFile("ProcessModels/acp3-process.lsp");
- See Also:
- WatcherListener, ProcessViewer
-
allNodes
-
-
changedNodes
-
-
nodeTable
-
-
numberOfCoas
-
-
overallColumn
-
-
rowTable
-
-
schemaTable
-
-
viewer
-
-
ProcessModel()
- Create an empty ProcessModel.
-
addCoa(int)
- Add the actions for a new COA to the model.
-
addRowElement(ProcessModel. Node)
-
-
checkConnectivity()
- Checks that we can reach all of the nodes in various ways.
-
depthFirstFinishOrder(List, Function1)
-
-
dffoWalk_(Object, Function1, Hashtable, ListCollector)
-
-
ensureOverallCell(String)
-
-
finalNodes()
-
-
finalNodes(Enumeration, int)
-
-
findActionNode(String, int)
-
-
findNode(List)
-
-
findOverallCell(String)
-
-
finishAction(String, int)
- Called by a watcher when it detects that an action has finished.
-
finishAction(String, int, int)
- Called by a watcher when it detects that an action has finished.
-
fullStateDescription()
-
-
initFromFile(String)
- Read action definitions from a file.
-
initialNodes()
-
-
initialNodes(Enumeration, int)
-
-
issueCounts()
-
-
newOverallCellInstance(String)
- Create an instance of an appropriate OverallCell class.
-
nodesAfter(ProcessModel. Node)
-
-
nodesBefore(ProcessModel. Node)
-
-
nodesBetween(ProcessModel. Node, ProcessModel. Node)
-
-
nodesInDepthFirstFinishOrder()
-
-
registerNode(ProcessModel. Node)
-
-
reset()
- Remove all COAs, their associated actions, and all current state
information.
-
resetChangeRecord()
-
-
seeIfNewCoa(int)
-
-
sendFullStateDescription()
- Send the viewer a complete state description, rather than a delta.
-
setViewer(ProcessViewer)
- Install a viewer that will be sent status information when changes
occur.
-
startAction(String, int)
- Called by a watcher when it detects that an action has started.
-
startAction(String, int, int)
- Called by a watcher when it detects that an action has started.
-
startRecordingChanges()
-
-
statusChanges()
-
-
tellViewer()
-
-
topLevelNodes()
-
viewer
ProcessViewer viewer
schemaTable
ProcessModel. SchemaTable schemaTable
nodeTable
ProcessModel. NodeTable nodeTable
allNodes
Vector allNodes
rowTable
Hashtable rowTable
overallColumn
Hashtable overallColumn
numberOfCoas
int numberOfCoas
changedNodes
HashSet changedNodes
ProcessModel
public ProcessModel()
- Create an empty ProcessModel.
setViewer
public synchronized void setViewer(ProcessViewer viewer)
- Install a viewer that will be sent status information when changes
occur.
initFromFile
public synchronized void initFromFile(String filename)
- Read action definitions from a file. Each action definition (or schema)
specifies the subactions (if any), a partial order over the subactions,
and any special properties of the action that affect how it is modelled.
This information is used when building data structures that represent
the actions that are present in the process being modelled.
reset
public synchronized void reset()
- Remove all COAs, their associated actions, and all current state
information. However, the definitions established by the most
recent call to initFromFile remain; it is not necessary to call
it again after a reset.
addCoa
public synchronized void addCoa(int coaNumber)
- Add the actions for a new COA to the model. Note that the new
COA's number must be exactly one greater than the current number
of COAs. The only way to add a higher-numbered COA is to call
addCoa more than once.
sendFullStateDescription
public synchronized void sendFullStateDescription()
- Send the viewer a complete state description, rather than a delta.
This is normally a request from the viewer, for instance if it has
been ignoring changes (for some reason) and wants to catch up.
fullStateDescription
protected Vector fullStateDescription()
startAction
public void startAction(String action,
int coa)
- Called by a watcher when it detects that an action has started.
startAction
public synchronized void startAction(String action,
int coa,
int level)
- Called by a watcher when it detects that an action has started.
finishAction
public void finishAction(String action,
int coa)
- Called by a watcher when it detects that an action has finished.
finishAction
public synchronized void finishAction(String action,
int coa,
int level)
- Called by a watcher when it detects that an action has finished.
seeIfNewCoa
protected void seeIfNewCoa(int coa)
startRecordingChanges
protected void startRecordingChanges()
resetChangeRecord
protected void resetChangeRecord()
tellViewer
protected void tellViewer()
statusChanges
protected Vector statusChanges()
issueCounts
protected int[] issueCounts()
registerNode
void registerNode(ProcessModel. Node node)
findNode
protected ProcessModel. Node findNode(List pattern)
findActionNode
public ProcessModel. Node findActionNode(String action,
int coa)
addRowElement
void addRowElement(ProcessModel. Node node)
ensureOverallCell
ProcessModel. OverallCell ensureOverallCell(String action)
findOverallCell
ProcessModel. OverallCell findOverallCell(String action)
topLevelNodes
public List topLevelNodes()
initialNodes
public List initialNodes()
initialNodes
public List initialNodes(Enumeration ne,
int level)
finalNodes
public List finalNodes()
finalNodes
public List finalNodes(Enumeration ne,
int level)
nodesBefore
public List nodesBefore(ProcessModel. Node after)
nodesAfter
public List nodesAfter(ProcessModel. Node before)
nodesBetween
public List nodesBetween(ProcessModel. Node before,
ProcessModel. Node after)
nodesInDepthFirstFinishOrder
public List nodesInDepthFirstFinishOrder()
depthFirstFinishOrder
public List depthFirstFinishOrder(List roots,
Function1 successors)
dffoWalk_
private void dffoWalk_(Object at,
Function1 sf,
Hashtable marks,
ListCollector result)
checkConnectivity
public synchronized void checkConnectivity()
- Checks that we can reach all of the nodes in various ways.
This method is not called during the normal operation of the
process model but can be called when testing.
newOverallCellInstance
ProcessModel. OverallCell newOverallCellInstance(String action)
- Create an instance of an appropriate OverallCell class.
All Packages Class Hierarchy This Package Previous Next Index