edu.rice.cs.cunit.instrumentors.util
Class CompoundStrategy

java.lang.Object
  extended by edu.rice.cs.cunit.instrumentors.util.CompoundStrategy
All Implemented Interfaces:
IInstrumentationStrategy, IScannerStrategy
Direct Known Subclasses:
CompoundCompactRecordStrategy, CompoundCompactSystemStrategy, CompoundReflectionThreadCheckStrategy, CompoundThreadCheckStrategy, CompoundYieldStrategy

public class CompoundStrategy
extends java.lang.Object
implements IInstrumentationStrategy, IScannerStrategy

Decorator to execute several strategies at once.

Author:
Mathias Ricken

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.rice.cs.cunit.instrumentors.util.IScannerStrategy
IScannerStrategy.IScanResult
 
Field Summary
(package private)  java.util.ArrayList<IInstrumentationStrategy> _combined
          Contained strategies.
(package private)  java.util.List<java.lang.String> _parameters
          Parameters for the instrumentors.
 
Constructor Summary
CompoundStrategy(java.util.List<java.lang.String> parameters)
          Constructor for an empty compound strategy.
CompoundStrategy(java.util.List<java.lang.String> parameters, IInstrumentationStrategy[] contained)
          Constructor for a compound strategy.
 
Method Summary
 void done()
          Instrumentation of all classes is done.
 java.util.List<IInstrumentationStrategy> getCombined()
          Returns the list of combined strategies.
 java.util.List<IScannerStrategy.IScanResult> getScanResults()
          Returns the combined list of all scan results.
 void instrument(ClassFile cf)
          Instrument the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_parameters

java.util.List<java.lang.String> _parameters
Parameters for the instrumentors.


_combined

java.util.ArrayList<IInstrumentationStrategy> _combined
Contained strategies.

Constructor Detail

CompoundStrategy

public CompoundStrategy(java.util.List<java.lang.String> parameters)
Constructor for an empty compound strategy.

Parameters:
parameters - parameters for the instrumentors

CompoundStrategy

public CompoundStrategy(java.util.List<java.lang.String> parameters,
                        IInstrumentationStrategy[] contained)
Constructor for a compound strategy.

Parameters:
parameters - parameters for the instrumentors
contained - strategies to combine
Method Detail

getCombined

public java.util.List<IInstrumentationStrategy> getCombined()
Returns the list of combined strategies.

Returns:
list of combined strategies.

instrument

public void instrument(ClassFile cf)
Instrument the class.

Specified by:
instrument in interface IInstrumentationStrategy
Parameters:
cf - class file info

getScanResults

public java.util.List<IScannerStrategy.IScanResult> getScanResults()
Returns the combined list of all scan results.

Specified by:
getScanResults in interface IScannerStrategy
Returns:
combined list of usage locations

done

public void done()
Instrumentation of all classes is done.

Specified by:
done in interface IInstrumentationStrategy