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

java.lang.Object
  extended by edu.rice.cs.cunit.instrumentors.util.ConditionalStrategy
All Implemented Interfaces:
IInstrumentationStrategy

public abstract class ConditionalStrategy
extends java.lang.Object
implements IInstrumentationStrategy

Decorator to conditionally execute a decorated strategy.

Author:
Mathias Ricken

Field Summary
(package private)  IInstrumentationStrategy _decoree
          Decorated strategy;
 
Constructor Summary
ConditionalStrategy(IInstrumentationStrategy decoree)
           
 
Method Summary
abstract  boolean apply(ClassFile cf)
          Return true if the decoree should be applied to this class.
 void done()
          Instrumentation of all classes is done.
 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

_decoree

IInstrumentationStrategy _decoree
Decorated strategy;

Constructor Detail

ConditionalStrategy

public ConditionalStrategy(IInstrumentationStrategy decoree)
Method Detail

instrument

public void instrument(ClassFile cf)
Instrument the class.

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

apply

public abstract boolean apply(ClassFile cf)
Return true if the decoree should be applied to this class.

Returns:
true if decoree should be applied.

done

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

Specified by:
done in interface IInstrumentationStrategy