Class ActorCount
- java.lang.Object
-
- pl.put.poznan.sqc.domain.visitors.ActorCount
-
- All Implemented Interfaces:
Visitor
- Direct Known Subclasses:
LonelyActorAccumulator
public class ActorCount extends Object implements Visitor
A visitor that
-
-
Constructor Summary
Constructors Constructor Description ActorCount()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HashMap<String,Integer>
getActorCounter()
String
stripKeywords(String original)
Strips keywords from the beginning of a given string.void
visit(Scenario scenario)
Reads all actors and system actors from a scenario.void
visit(Step step)
Checks how many actors are there in a step For each occurrence gets actor's name and increments occurrence timevoid
visit(StepList list)
Visit a list of steps.
-
-
-
Method Detail
-
visit
public void visit(Scenario scenario)
Reads all actors and system actors from a scenario.Actor names are transformed to lower case and stored in a hashmap Later, they are compared to the first word in a step. When they match, actor's count will increase by 1.
- Specified by:
visit
in interfaceVisitor
- Parameters:
scenario
- Scenario which will be analysed- See Also:
Scenario.getActors()
,Scenario.getSystemActors()
,ActorlessAccumulator.visit(Step)
-
visit
public void visit(Step step)
Checks how many actors are there in a step For each occurrence gets actor's name and increments occurrence time- Specified by:
visit
in interfaceVisitor
- Parameters:
step
- Step which will be analysed- See Also:
Step.accept(Visitor)
-
visit
public void visit(StepList list)
Description copied from interface:Visitor
Visit a list of steps.- Specified by:
visit
in interfaceVisitor
- Parameters:
list
- StepList which will be analysed.- See Also:
StepList.accept(Visitor)
-
stripKeywords
public String stripKeywords(String original)
Strips keywords from the beginning of a given string.Supported keywords are
IF
,ELSE
,FOR EACH
.- Parameters:
original
-- Returns:
- stripped text from step
-
-