edu.ucsb.ccs.jcontractor
Class SimpleInstrumentationFilter

java.lang.Object
  |
  +--edu.ucsb.ccs.jcontractor.SimpleInstrumentationFilter
All Implemented Interfaces:
InstrumentationFilter

public class SimpleInstrumentationFilter
extends java.lang.Object
implements InstrumentationFilter

An instrumentation filter that assign the same instrumentation level to all classes. This filter is good for implementing defaults.

Version:
$Id: SimpleInstrumentationFilter.java,v 1.1 2002/03/28 19:21:57 parkera Exp $
Author:
Parker Abercrombie

Field Summary
 
Fields inherited from interface edu.ucsb.ccs.jcontractor.InstrumentationFilter
ALL, NONE, POST, PRE
 
Constructor Summary
SimpleInstrumentationFilter(int level)
          Create a filter to assign the given instrumentation level.
 
Method Summary
 boolean appliesTo(java.lang.String theclass)
          Always returns true, this filter applies to all classes.
 int getFilterLevel()
          Get the filter level.
 int getInstrumentationLevel(java.lang.String classname)
          Get the instrumentation level for a class.
 java.lang.String toString()
          Get a string representation of the filter, for debugging.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleInstrumentationFilter

public SimpleInstrumentationFilter(int level)
Create a filter to assign the given instrumentation level.

Parameters:
level - the instrumentation level to assign to all classes.
Method Detail

getInstrumentationLevel

public int getInstrumentationLevel(java.lang.String classname)
Get the instrumentation level for a class.

Specified by:
getInstrumentationLevel in interface InstrumentationFilter
Parameters:
classname - the name of the class to get the instrumentation level of.
Returns:
the instrumentation level specified by instrumentationLevel. All classes are assigned the same level.

appliesTo

public boolean appliesTo(java.lang.String theclass)
Always returns true, this filter applies to all classes.

Specified by:
appliesTo in interface InstrumentationFilter
Parameters:
theclass - the name of a class to test.
Returns:
true.

getFilterLevel

public int getFilterLevel()
Get the filter level. Always returns zero.

Specified by:
getFilterLevel in interface InstrumentationFilter
Returns:
zero.

toString

public java.lang.String toString()
Get a string representation of the filter, for debugging.

Overrides:
toString in class java.lang.Object