objectgen.activitymodel
Class Decision

java.lang.Object
  extended byobjectgen.activitymodel.Activity
      extended byobjectgen.activitymodel.Decision
All Implemented Interfaces:
java.lang.Cloneable, IControlFlow, java.util.Iterator, java.io.Serializable

public class Decision
extends Activity
implements java.util.Iterator, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected static int IdIndex
          Allowa to calculate an id for the desicions
protected  java.util.ArrayList next
          Stores the several alternatives of a decision
 
Fields inherited from class objectgen.activitymodel.Activity
description, id, participant
 
Constructor Summary
Decision()
          Creates a new instance of Decision
 
Method Summary
 int alternativeNumber()
          Return the number of alternatives
static Decision BuildDesicion(Decision d, Alternative alt)
          This method allos to create decisions with only one alternative for test objectives
 java.lang.String getConditionForNode(java.lang.String id)
          Returns the condition to go to the activity with the specified id.
 Alternative getFirstAlternative()
          Paths has only one alternative
 java.lang.String getNext()
          Always returns null
 boolean hasNext()
           
 boolean isDesicion()
          Always returns true
 java.util.Iterator iterator()
           
 java.lang.Object next()
           
 void remove()
          Not implemented
 void setAlternative(Alternative alternative)
          Add a new alternative branch
 void setId(java.lang.String id)
          Overloaded.
 java.lang.String toString()
          For testing purpouse
 
Methods inherited from class objectgen.activitymodel.Activity
BuildFinal, clone, equals, getDescription, getId, getParticipant, isFinal, isNext, setDescription, setNext, setNext, setParticipant
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

next

protected java.util.ArrayList next
Stores the several alternatives of a decision


IdIndex

protected static int IdIndex
Allowa to calculate an id for the desicions

Constructor Detail

Decision

public Decision()
Creates a new instance of Decision

Method Detail

setId

public void setId(java.lang.String id)
Overloaded. Now, ids are setted automatically by this class

Overrides:
setId in class Activity

isDesicion

public boolean isDesicion()
Always returns true

Overrides:
isDesicion in class Activity

getNext

public java.lang.String getNext()
Always returns null

Specified by:
getNext in interface IControlFlow
Overrides:
getNext in class Activity

setAlternative

public void setAlternative(Alternative alternative)
Add a new alternative branch


getFirstAlternative

public Alternative getFirstAlternative()
Paths has only one alternative


getConditionForNode

public java.lang.String getConditionForNode(java.lang.String id)
Returns the condition to go to the activity with the specified id. This method is usefull when generating guards in XMI behavioural model


alternativeNumber

public int alternativeNumber()
Return the number of alternatives


iterator

public java.util.Iterator iterator()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

remove

public void remove()
Not implemented

Specified by:
remove in interface java.util.Iterator

toString

public java.lang.String toString()
For testing purpouse

Overrides:
toString in class Activity

BuildDesicion

public static Decision BuildDesicion(Decision d,
                                     Alternative alt)
This method allos to create decisions with only one alternative for test objectives