ucot.input
Class UseCase

java.lang.Object
  extended by ucot.input.UseCase
All Implemented Interfaces:
java.lang.Iterable<UseCaseStep>

public class UseCase
extends java.lang.Object
implements java.lang.Iterable<UseCaseStep>

UseCase class. Contains UseCaseSteps related to this usecase.

Author:
vevijopi

Field Summary
private  HeuristicInterface heuristic
          Which heuristicInterface was used on this usecase
private  boolean isUseCaseAnalyzed
          Ise usecase added to current analyze model.
private  AnalyzeModel model
          When heuristic was ran on this usecase, this model was created.
private  java.lang.String name
           
private  ParserInterface parser
          Which parserInterface was used on this usecase
private  boolean subUseCase
          Is this a sub-usecase, mainly used when connecting sub-usecases to usecase steps
private  java.net.URL url
           
private  java.lang.String useCaseId
          UseCase's id loaded from processml files or from simple usecase format Only used for connecting usecase steps to sub-usecases
private  java.util.Vector<UseCaseStep> useCaseSteps
          Vector that contains all usecase steps
 
Constructor Summary
UseCase()
           
 
Method Summary
 void addStep(java.lang.String step, UseCase subUseCase)
          Adds a new step to this usecase
 void addStep(UseCaseStep step)
          Adds a new UseCaseStep to this usecase
 void clear()
          Removes all usecase's steps
 boolean equals(java.lang.Object obj)
          Equals method for usecases.
 AnalyzeModel getAnalyzeModel()
          Returns the (mini) analyzemodel that was created from this (and only this) usecase
 HeuristicInterface getHeuristic()
          Get the heuristic that was used on this usecase
 java.lang.String getHeuristicName()
          Returns name of the heuristic that was used in creating this usecase
 java.lang.String getName()
          Returns this usecase's name
 ParserInterface getParser()
          Get the parser that was used on this usecase
 java.lang.String getParserName()
          Returns name of the parser that was used in creating this usecase
 UseCaseStep getStep(int index)
          Returns step with given index
 int getStepCount()
          Returns the count of steps this usecase has
 java.net.URL getUrl()
          Returns the url where this usecase was loaded from
 java.lang.String getUseCaseId()
          Returns this usecase's id.
 boolean isSubUseCase()
          Is this usecase a sub-usecaes
 boolean isUseCaseAnalyzed()
          Is this usecase analyzed and added to main analyzemodel
 java.util.Iterator<UseCaseStep> iterator()
          Iterator for the usecase steps
 void setAnalyzeModel(AnalyzeModel model)
          Sets the (mini) analyzemodel that was created from this (and only this) usecase
 void setAsSubUseCase(boolean sub)
          Mark this usecase as a sub usecase
 void setHeuristic(HeuristicInterface heuristic)
          Set the heuristic that was used to this usecaes
 void setId(java.lang.String relationId)
          Set relation id for this usecase.
 void setName(java.lang.String name)
          Sets a new name for this usecase
 void setParser(ParserInterface parser)
          Set the parser that was used to parse this usecase
 void setUrl(java.net.URL url)
          Sets the url where this usecase was loaded from
 void setUseCaseAnalyzed()
          mark this usecase as anlyzed
 void setUseCaseAnalyzed(boolean analyzed)
          Set wheiter this usecase is analyzed.
 java.lang.String toString()
          Returns this usecase as a string with this format: Name --- (step index).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

useCaseSteps

private java.util.Vector<UseCaseStep> useCaseSteps
Vector that contains all usecase steps


url

private java.net.URL url

name

private java.lang.String name

isUseCaseAnalyzed

private boolean isUseCaseAnalyzed
Ise usecase added to current analyze model.


subUseCase

private boolean subUseCase
Is this a sub-usecase, mainly used when connecting sub-usecases to usecase steps


model

private AnalyzeModel model
When heuristic was ran on this usecase, this model was created. It was later added to the main usecase, but a copy was left. This copy is used for highlighting.


heuristic

private HeuristicInterface heuristic
Which heuristicInterface was used on this usecase


parser

private ParserInterface parser
Which parserInterface was used on this usecase


useCaseId

private java.lang.String useCaseId
UseCase's id loaded from processml files or from simple usecase format Only used for connecting usecase steps to sub-usecases

Constructor Detail

UseCase

public UseCase()
Method Detail

setParser

public void setParser(ParserInterface parser)
Set the parser that was used to parse this usecase

Parameters:
parser - parser that was used

setHeuristic

public void setHeuristic(HeuristicInterface heuristic)
Set the heuristic that was used to this usecaes

Parameters:
heuristic - heuristic

getParser

public ParserInterface getParser()
Get the parser that was used on this usecase

Returns:

getHeuristic

public HeuristicInterface getHeuristic()
Get the heuristic that was used on this usecase

Returns:

getParserName

public java.lang.String getParserName()
Returns name of the parser that was used in creating this usecase

Returns:

getHeuristicName

public java.lang.String getHeuristicName()
Returns name of the heuristic that was used in creating this usecase

Returns:

getAnalyzeModel

public AnalyzeModel getAnalyzeModel()
Returns the (mini) analyzemodel that was created from this (and only this) usecase

Returns:

setAnalyzeModel

public void setAnalyzeModel(AnalyzeModel model)
Sets the (mini) analyzemodel that was created from this (and only this) usecase

Parameters:
a -

setAsSubUseCase

public void setAsSubUseCase(boolean sub)
Mark this usecase as a sub usecase

Parameters:
sub - true if this usecase is a sub-usecase

isSubUseCase

public boolean isSubUseCase()
Is this usecase a sub-usecaes

Returns:
true if it is

isUseCaseAnalyzed

public boolean isUseCaseAnalyzed()
Is this usecase analyzed and added to main analyzemodel

Returns:
true if it is

setUseCaseAnalyzed

public void setUseCaseAnalyzed(boolean analyzed)
Set wheiter this usecase is analyzed.

Parameters:
analyzed - is the usecase analyzed

setUseCaseAnalyzed

public void setUseCaseAnalyzed()
mark this usecase as anlyzed


iterator

public java.util.Iterator<UseCaseStep> iterator()
Iterator for the usecase steps

Specified by:
iterator in interface java.lang.Iterable<UseCaseStep>

setId

public void setId(java.lang.String relationId)
Set relation id for this usecase. Only used for connecting UseCaseSteps to subusecases

Parameters:
relationId - this usecase's id loaded from file

getUseCaseId

public java.lang.String getUseCaseId()
Returns this usecase's id.

Returns:
usecase id

getStepCount

public int getStepCount()
Returns the count of steps this usecase has

Returns:
step count

getStep

public UseCaseStep getStep(int index)
Returns step with given index

Parameters:
index - index of the step
Returns:
UseCaseStep or null if index was incorrect

clear

public void clear()
Removes all usecase's steps


addStep

public void addStep(java.lang.String step,
                    UseCase subUseCase)
Adds a new step to this usecase

Parameters:
step - step's description
subUseCase - reference to sub usecase

addStep

public void addStep(UseCaseStep step)
Adds a new UseCaseStep to this usecase

Parameters:
step - UseCaseStep object to add

getUrl

public java.net.URL getUrl()
Returns the url where this usecase was loaded from

Returns:

setUrl

public void setUrl(java.net.URL url)
Sets the url where this usecase was loaded from

Parameters:
url -

getName

public java.lang.String getName()
Returns this usecase's name

Returns:
name

setName

public void setName(java.lang.String name)
Sets a new name for this usecase

Parameters:
name - new name

toString

public java.lang.String toString()
Returns this usecase as a string with this format: Name --- (step index). (step) (step index). (step) ...

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Equals method for usecases. For now, we don't care about sub-usecases. Should we?

Overrides:
equals in class java.lang.Object