Package randoop
Class MultiVisitor
java.lang.Object
randoop.MultiVisitor
- All Implemented Interfaces:
ExecutionVisitor
An execution visitor that chains a list of visitors in sequence. It can be used if the user wants
to use more than one visitor to visit a sequence during execution.
When the visitBefore method is called on this visitor, it calls visitMethod on each of the sub-visitors in the order in which the sub-visitors were given when constructing this visitor.
When the visitAfter method is called on this visitor, it calls visitAfter on each of the sub-visitors in turn, also in the order in which they were given when constructing the visitor. If one of these calls returns false, this visitor immediately returns false without calling visitAfter on the remaining visitors.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a new MultiVisitor.MultiVisitor
(List<ExecutionVisitor> visitors) Creates a new MultiVisitor. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutionVisitor
createMultiVisitor
(List<ExecutionVisitor> visitors) Returns a MultiVisitor if needed, otherwise a simpler visitor.void
initialize
(ExecutableSequence eseq) Calls the initialize method for each of the visitors, in the order in which the visitors were given during construction of this MultiVisitor.void
Called after execution of a sequence.void
visitAfterStatement
(ExecutableSequence eseq, int i) Invoked by ExecutableSequence.execute after the i-th statement executes.void
visitBeforeStatement
(ExecutableSequence eseq, int i) Invoked by ExecutableSequence.execute before the i-th statement executes.
-
Field Details
-
visitors
The list of visitors.
-
-
Constructor Details
-
MultiVisitor
public MultiVisitor()Creates a new MultiVisitor. -
MultiVisitor
Creates a new MultiVisitor.- Parameters:
visitors
- the list of visitors
-
-
Method Details
-
createMultiVisitor
Returns a MultiVisitor if needed, otherwise a simpler visitor.- Parameters:
visitors
- the visitors to compose- Returns:
- a visitor that has the effect of all the visitors in the argument
-
initialize
Calls the initialize method for each of the visitors, in the order in which the visitors were given during construction of this MultiVisitor.- Specified by:
initialize
in interfaceExecutionVisitor
- Parameters:
eseq
- the code sequence to be visited
-
visitAfterStatement
Description copied from interface:ExecutionVisitor
Invoked by ExecutableSequence.execute after the i-th statement executes.Precondition: statements 0..i have been executed.
- Specified by:
visitAfterStatement
in interfaceExecutionVisitor
- Parameters:
eseq
- the code sequence to be visitedi
- the position of statement to visit
-
visitBeforeStatement
Description copied from interface:ExecutionVisitor
Invoked by ExecutableSequence.execute before the i-th statement executes.Precondition: statements 0..i-1 have been executed.
- Specified by:
visitBeforeStatement
in interfaceExecutionVisitor
- Parameters:
eseq
- the code sequence to be visitedi
- the position of statement to visit
-
visitAfterSequence
Description copied from interface:ExecutionVisitor
Called after execution of a sequence.- Specified by:
visitAfterSequence
in interfaceExecutionVisitor
- Parameters:
eseq
- the visited code sequence
-