modesteditor.core.stepsimulation
Class SimulationNode

java.lang.Object
  extended by modesteditor.core.stepsimulation.SimulationNode
Direct Known Subclasses:
ActionNode, Alternative, AltNode, BreakNode, PaltTransition, ParNode, ParTransition, SequentialProcess, ThrowNode, TryNode

public abstract class SimulationNode
extends java.lang.Object

This is a generic node in the stepsimulation tree.


Field Summary
protected  java.util.ArrayList<java.lang.String> alphabet
           
protected  java.util.ArrayList<SimulationNode> children
           
protected  int column
           
protected  java.lang.String guard
           
protected  boolean hidden
           
protected  boolean isActive
           
protected  int length
           
protected  int line
           
protected  java.lang.String newLabel
           
protected  SimulationNode parent
           
 
Constructor Summary
SimulationNode()
           
SimulationNode(int line, int column)
          Constructor setting the line and column of the node.
 
Method Summary
 void addChild(SimulationNode child)
          Method which adds a child to the children list
 void breakTransitionTaken()
          Method that propagates the break action until it reaches a do.
abstract  void childIsFinished(SimulationNode child)
          Child notifies the parent that is is finished.
abstract  java.util.List<ParTransition> collectParTransitions()
          Abstract method for generating the list of parallel transitions of the node.
abstract  java.util.List<SimulationNode> collectTransitions()
          Abstract method for generating the list of possible transitions.
 java.util.ArrayList<org.eclipse.core.resources.IMarker> createSimHighlighting(org.eclipse.core.resources.IResource resource, org.eclipse.jface.text.IDocument document, boolean isPalt)
          Method that creates the markers that do the highlighting in the step simulation.
 void exceptionThrown(ThrowNode exc)
          Method calling repeatedly the same method in the parent until it reaches a TryNode or the root.
abstract  void generateAlphabet()
          Abstract method to generate the alphabet of the node.
 java.util.ArrayList<java.lang.String> getAlphabet()
           
 int getColumn()
           
 java.lang.String getGuard()
           
 int getLength()
           
 int getLine()
           
 java.lang.String getName()
           
 SimulationNode getParent()
           
 java.util.ArrayList<SimulationNode> getParentList()
           
 void hide()
          Method hides the action for printing.
 boolean isActive()
           
 void isFinished()
          Method called when the node is completely processed
 boolean isHidden()
           
abstract  void notificationOfChildActivity(SimulationNode child)
          Method which is called from the child in order to notify the parent that it is active.
 java.lang.String printTransition()
          Method that prints the SimulationNode TODO better incoporation in Eclipse
 void relabelNode(java.lang.String newLabel)
           
abstract  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()
           
 void setParent(SimulationNode parent)
           
 void stopCalled()
          Method calling repeatedly the same method in the parent until it reaches the root.
abstract  void takeTransition()
          Abstract method for taking a Transition, the node will care for itself how it organizes the transition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected SimulationNode parent

isActive

protected boolean isActive

alphabet

protected java.util.ArrayList<java.lang.String> alphabet

children

protected java.util.ArrayList<SimulationNode> children

line

protected int line

column

protected int column

length

protected int length

guard

protected java.lang.String guard

hidden

protected boolean hidden

newLabel

protected java.lang.String newLabel
Constructor Detail

SimulationNode

public SimulationNode()

SimulationNode

public SimulationNode(int line,
                      int column)
Constructor setting the line and column of the node.

Parameters:
line -
column -
Method Detail

takeTransition

public abstract void takeTransition()
Abstract method for taking a Transition, the node will care for itself how it organizes the transition.

Parameters:
node -

generateAlphabet

public abstract void generateAlphabet()
Abstract method to generate the alphabet of the node.


isFinished

public void isFinished()
Method called when the node is completely processed


collectTransitions

public abstract java.util.List<SimulationNode> collectTransitions()
Abstract method for generating the list of possible transitions.

Returns:
the list of transitions

collectParTransitions

public abstract java.util.List<ParTransition> collectParTransitions()
Abstract method for generating the list of parallel transitions of the node. The method also adds disabled transitions for the letters in the alphabet that cannot be taken.

Returns:
the list of parallel transitions

addChild

public void addChild(SimulationNode child)
Method which adds a child to the children list

Parameters:
child -

childIsFinished

public abstract void childIsFinished(SimulationNode child)
Child notifies the parent that is is finished. Parent has to check if it is finished too.

Parameters:
child -

breakTransitionTaken

public void breakTransitionTaken()
Method that propagates the break action until it reaches a do. Is overwritten in the DoNode class.


releaseTransitions

public abstract 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 ...


notificationOfChildActivity

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

Parameters:
child -

printTransition

public java.lang.String printTransition()
Method that prints the SimulationNode TODO better incoporation in Eclipse


stopCalled

public void stopCalled()
Method calling repeatedly the same method in the parent until it reaches the root. This happens when a STOP action is taken and thus stopps the simulation.


exceptionThrown

public void exceptionThrown(ThrowNode exc)
Method calling repeatedly the same method in the parent until it reaches a TryNode or the root.

Parameters:
exc -

getParentList

public java.util.ArrayList<SimulationNode> getParentList()

createSimHighlighting

public java.util.ArrayList<org.eclipse.core.resources.IMarker> createSimHighlighting(org.eclipse.core.resources.IResource resource,
                                                                                     org.eclipse.jface.text.IDocument document,
                                                                                     boolean isPalt)
Method that creates the markers that do the highlighting in the step simulation. First creates the markers for itself and then for the parent hierarchy.

Parameters:
resource - where to add the markers
document - needed in order to calculate the offsets
Returns:
a list of markers so that those can be disposed of when not needed anymore

relabelNode

public void relabelNode(java.lang.String newLabel)

isActive

public boolean isActive()

setActive

public void setActive()

getParent

public SimulationNode getParent()

setParent

public void setParent(SimulationNode parent)

getAlphabet

public java.util.ArrayList<java.lang.String> getAlphabet()

getColumn

public int getColumn()

getLength

public int getLength()

getLine

public int getLine()

isHidden

public boolean isHidden()

hide

public void hide()
Method hides the action for printing.


getName

public java.lang.String getName()

getGuard

public java.lang.String getGuard()