modesteditor.core.stepsimulation
Class ParNode

java.lang.Object
  extended by modesteditor.core.stepsimulation.SimulationNode
      extended by modesteditor.core.stepsimulation.ParNode

public class ParNode
extends SimulationNode

Class representing a par statement in the step simulation tree.


Field Summary
 
Fields inherited from class modesteditor.core.stepsimulation.SimulationNode
alphabet, children, column, guard, hidden, isActive, length, line, newLabel, parent
 
Constructor Summary
ParNode(int line, int column, SimulationNode parent)
          Default constructor
 
Method Summary
 java.util.ArrayList<PaltTransition> buildPaltTransitions(java.util.ArrayList<ParTransition> trans)
          Method building the parallel PaltTransitions for the ParTransitions that have probabilistic alternatives.
 void childIsFinished(SimulationNode child)
          Method removes the finished child from the list of active children.
 java.util.List<ParTransition> collectParTransitions()
          Method first collects the ParTransitions from it's active children.
 java.util.List<SimulationNode> collectTransitions()
          Method returns the collected parallel transitions from collectParTransitions.
 void generateAlphabet()
          Abstract method to generate the alphabet of the node.
 java.util.ArrayList<SimulationNode> getParentList()
           
 void isFinished()
          Method called when the node is completely processed
 void notificationOfChildActivity(SimulationNode child)
          Method which is called from the child in order to notify the parent that it is active.
 void releaseTransitions()
          Method shall release the active transitions of the node an it's children in case a do loop is broken or a STOP occured ...
 void setActive()
          Sets all children active and register them in the activeChildren List.
 void takeTransition()
          Abstract method for taking a Transition, the node will care for itself how it organizes the transition.
 
Methods inherited from class modesteditor.core.stepsimulation.SimulationNode
addChild, breakTransitionTaken, createSimHighlighting, exceptionThrown, getAlphabet, getColumn, getGuard, getLength, getLine, getName, getParent, hide, isActive, isHidden, printTransition, relabelNode, setParent, stopCalled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParNode

public ParNode(int line,
               int column,
               SimulationNode parent)
Default constructor

Parameters:
line -
column -
parent -
Method Detail

setActive

public void setActive()
Sets all children active and register them in the activeChildren List. Builds the common alphabet. super.setActive() called last, so that the alphabet of the children is already generated.

Overrides:
setActive in class SimulationNode

childIsFinished

public void childIsFinished(SimulationNode child)
Method removes the finished child from the list of active children. If this list is empty, the ParNode is finished too.

Specified by:
childIsFinished in class SimulationNode
Parameters:
child - that is finished

isFinished

public void isFinished()
Description copied from class: SimulationNode
Method called when the node is completely processed

Overrides:
isFinished in class SimulationNode

collectTransitions

public java.util.List<SimulationNode> collectTransitions()
Method returns the collected parallel transitions from collectParTransitions. This method is responsible for switching from a collectTransitions call tree to a collectParTransitions call tree.

Specified by:
collectTransitions in class SimulationNode
Returns:
the list of transitions

collectParTransitions

public java.util.List<ParTransition> collectParTransitions()
Method first collects the ParTransitions from it's active children. These parallel transitions are then organized into single parallel transitions respecting the action they are representing, the enabledness of such a transition and the different alternatives of a node.

Specified by:
collectParTransitions in class SimulationNode
Returns:
the list of parallel transitions

buildPaltTransitions

public java.util.ArrayList<PaltTransition> buildPaltTransitions(java.util.ArrayList<ParTransition> trans)
Method building the parallel PaltTransitions for the ParTransitions that have probabilistic alternatives.

Parameters:
trans - List of the transitions with the p-alternatives.
Returns:
the list of PaltTransitions for a specific letter of the common alphabet.

generateAlphabet

public void generateAlphabet()
Description copied from class: SimulationNode
Abstract method to generate the alphabet of the node.

Specified by:
generateAlphabet in class SimulationNode

releaseTransitions

public void releaseTransitions()
Description copied from class: SimulationNode
Method shall release the active transitions of the node an it's children in case a do loop is broken or a STOP occured ...

Specified by:
releaseTransitions in class SimulationNode

takeTransition

public void takeTransition()
Description copied from class: SimulationNode
Abstract method for taking a Transition, the node will care for itself how it organizes the transition.

Specified by:
takeTransition in class SimulationNode

notificationOfChildActivity

public void notificationOfChildActivity(SimulationNode child)
Description copied from class: SimulationNode
Method which is called from the child in order to notify the parent that it is active.

Specified by:
notificationOfChildActivity in class SimulationNode

getParentList

public java.util.ArrayList<SimulationNode> getParentList()
Overrides:
getParentList in class SimulationNode