de.uni_paderborn.fujaba.sequencer
Class Sequencer

java.lang.Object
  extended byde.uni_paderborn.fujaba.sequencer.Sequencer

public class Sequencer
extends java.lang.Object

Used in code generation of activity diagrams for exploring the control flow.

Version:
$Revision: 1.51 $
Author:
$Author: cschneid $

Field Summary
(package private) static int level
          level: counter for checkForEachStructure() 0 : unexplored 1 : normal flow 2..n : ForEach level
private static Sequencer theSequencer
          No comment provided by developer, please add a comment to improve documentation.
(package private) static int time
          time: counter for dfs() will be incremented with each new node
 
Constructor Summary
private Sequencer()
          Constructor for class Sequencer
 
Method Summary
private  void buildForEachStructure(de.upb.tools.fca.FLinkedList transitionList)
          buildForEachStructure()
private  void checkForEachStructure(FlowActivity flowActivity, de.upb.tools.fca.FLinkedList transitionList)
          Checks the 'ForEach' structure and collects all 'each time' transitions in a list
private  void checkTransitionGuards(UMLTransitionGuard leftGuard, UMLTransitionGuard rightGuard)
          Checks if the two guards are compatible.
private  void dfs(FlowActivity currentFlowActivity)
          Depth First Search.
private  void explore(Seq seq, FlowActivity startFlowActivity, FlowActivity endFlowActivity)
          Run dfs and checkForEachStructure before in exactly this order!
private  void exploreAndCollect(de.upb.tools.fca.FHashSet set, FlowActivity start, FlowActivity end)
          Walk through the tree and collect nodes.
private  void exploreAndCompare(de.upb.tools.fca.FHashSet leftSet, de.upb.tools.fca.FHashSet rightSet, FlowActivity start, FlowActivity end)
          Walk through the tree and collect nodes until a node was foud which is in a given set.
private  void exploreBackwardAndCollect(de.upb.tools.fca.FHashSet set, FlowActivity start, FlowActivity end)
          No comment provided by developer, please add a comment to improve documentation.
 Seq exploreCFG(FlowActivity startFlowActivity)
          exploreCFG
private  void exploreRepetition(Seq seq, UMLTransition backUMLTransition, FlowActivity start, FlowActivity end)
          No comment provided by developer, please add a comment to improve documentation.
private  void exploreSelection(Seq seq, UMLTransition firstUMLTransition, UMLTransition secondUMLTransition, FlowActivity start, FlowActivity end)
          No comment provided by developer, please add a comment to improve documentation.
static Sequencer get()
          No comment provided by developer, please add a comment to improve documentation.
 de.upb.tools.fca.FHashSet intersection(de.upb.tools.fca.FHashSet setOne, de.upb.tools.fca.FHashSet setTwo)
          No comment provided by developer, please add a comment to improve documentation.
private  boolean isIntervalNested(de.upb.tools.fca.FLinkedList intervalList, de.upb.tools.fca.FLinkedList newInterval)
           
private  boolean isTheOnlyTransition(UMLActivity curActivity, UMLTransition curTransition)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theSequencer

private static Sequencer theSequencer
No comment provided by developer, please add a comment to improve documentation.


level

static int level
level: counter for checkForEachStructure() 0 : unexplored 1 : normal flow 2..n : ForEach level


time

static int time
time: counter for dfs() will be incremented with each new node

Constructor Detail

Sequencer

private Sequencer()
Constructor for class Sequencer

Method Detail

get

public static Sequencer get()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

exploreCFG

public final Seq exploreCFG(FlowActivity startFlowActivity)
exploreCFG

Parameters:
startFlowActivity - The start activity of the method
Returns:
a sequence for the CFG (note: the flow assocs of the activities in the diagram have to be set before and removed afterwards)

buildForEachStructure

private final void buildForEachStructure(de.upb.tools.fca.FLinkedList transitionList)
buildForEachStructure()

Parameters:
transitionList - List of transitions which are collected during checkForEachStructure phase For each 'every times' transition in transitionList, a flow will be created using explore(). This flow will be stored in the concerning flowActivity

checkForEachStructure

private final void checkForEachStructure(FlowActivity flowActivity,
                                         de.upb.tools.fca.FLinkedList transitionList)
Checks the 'ForEach' structure and collects all 'each time' transitions in a list

Parameters:
flowActivity - the actual activity which will be checked
transitionList - a list which stores all 'each time' transitions start createFlowActivities before if there was no error, items in transitionList will be used to create flows, collapse them and store them in the concerning flowActivities

dfs

private final void dfs(FlowActivity currentFlowActivity)
Depth First Search.

Parameters:
currentFlowActivity - No description provided

isTheOnlyTransition

private final boolean isTheOnlyTransition(UMLActivity curActivity,
                                          UMLTransition curTransition)
Parameters:
curActivity - No description provided
curTransition - No description provided
Returns:
true, if curTransition is the only transition which is leaving from curActivity.

isIntervalNested

private final boolean isIntervalNested(de.upb.tools.fca.FLinkedList intervalList,
                                       de.upb.tools.fca.FLinkedList newInterval)
Parameters:
intervalList - No description provided
newInterval - No description provided
Returns:
false if it is impossible to place the interval in the list or returns true and places the interval in the list, so that the smallest intervall is on first position.

explore

private final void explore(Seq seq,
                           FlowActivity startFlowActivity,
                           FlowActivity endFlowActivity)
Run dfs and checkForEachStructure before in exactly this order!

Parameters:
seq - Seqence to be filled
startFlowActivity - A flowActivity where to start from
endFlowActivity - A flowActivity up to which CFG will be explored (may be null for open end)

exploreBackwardAndCollect

private final void exploreBackwardAndCollect(de.upb.tools.fca.FHashSet set,
                                             FlowActivity start,
                                             FlowActivity end)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
set - No description provided
start - No description provided
end - No description provided

exploreRepetition

private final void exploreRepetition(Seq seq,
                                     UMLTransition backUMLTransition,
                                     FlowActivity start,
                                     FlowActivity end)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
seq - No description provided
backUMLTransition - No description provided
start - No description provided
end - No description provided

exploreAndCompare

private final void exploreAndCompare(de.upb.tools.fca.FHashSet leftSet,
                                     de.upb.tools.fca.FHashSet rightSet,
                                     FlowActivity start,
                                     FlowActivity end)
Walk through the tree and collect nodes until a node was foud which is in a given set.

Parameters:
leftSet - The given set with nodes to compare
rightSet - The set where to store the collected (visited) nodes in
start - The node where to start from
end - The deepest node to go

exploreAndCollect

private final void exploreAndCollect(de.upb.tools.fca.FHashSet set,
                                     FlowActivity start,
                                     FlowActivity end)
Walk through the tree and collect nodes.

Parameters:
set - The set where to store the collected (visited) nodes in
start - The node where to start from
end - The deepest node to go

checkTransitionGuards

private final void checkTransitionGuards(UMLTransitionGuard leftGuard,
                                         UMLTransitionGuard rightGuard)
Checks if the two guards are compatible.

Parameters:
leftGuard - Type of UMLTransitionGuard
rightGuard - Type of UMLTransitionGuard

exploreSelection

private final void exploreSelection(Seq seq,
                                    UMLTransition firstUMLTransition,
                                    UMLTransition secondUMLTransition,
                                    FlowActivity start,
                                    FlowActivity end)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
seq - No description provided
firstUMLTransition - No description provided
secondUMLTransition - No description provided
start - No description provided
end - No description provided

intersection

public de.upb.tools.fca.FHashSet intersection(de.upb.tools.fca.FHashSet setOne,
                                              de.upb.tools.fca.FHashSet setTwo)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
setOne - No description provided
setTwo - No description provided
Returns:
No description provided