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()StringstripKeywords(String original)Strips keywords from the beginning of a given string.voidvisit(Scenario scenario)Reads all actors and system actors from a scenario.voidvisit(Step step)Checks how many actors are there in a step For each occurrence gets actor's name and increments occurrence timevoidvisit(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:
visitin 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:
visitin interfaceVisitor- Parameters:
step- Step which will be analysed- See Also:
Step.accept(Visitor)
-
visit
public void visit(StepList list)
Description copied from interface:VisitorVisit a list of steps.- Specified by:
visitin 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
-
-