edu.ucsb.ccs.jcontractor
Class CompositeInstrumentationFilter

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

public class CompositeInstrumentationFilter
extends java.lang.Object
implements InstrumentationFilter

An instrumentation filter that combines other instrumentation filters.

Version:
$Id: CompositeInstrumentationFilter.java,v 1.3 2002/05/22 06:28:36 parkera Exp $
Author:
Parker Abercrombie

Field Summary
 
Fields inherited from interface edu.ucsb.ccs.jcontractor.InstrumentationFilter
ALL, NONE, POST, PRE
 
Constructor Summary
CompositeInstrumentationFilter()
          Create a new filter.
 
Method Summary
 void addFilter(InstrumentationFilter filter)
          Add a filter to the composite filter.
 boolean appliesTo(java.lang.String classname)
          Always returns true.
 int getFilterLevel()
          Get the filter level; always returns zero.
 java.util.LinkedList getFilters()
          Get the filters in the composite filter as a linked list.
 int getInstrumentationLevel(java.lang.String classname)
          Get the instrumentation level for a class.
 int size()
          Get the number of filters in this composite filter.
 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

CompositeInstrumentationFilter

public CompositeInstrumentationFilter()
Create a new filter.

Method Detail

addFilter

public void addFilter(InstrumentationFilter filter)
Add a filter to the composite filter.

Parameters:
filter - the filter to add.

getFilters

public java.util.LinkedList getFilters()
Get the filters in the composite filter as a linked list.

Returns:
the filters in the composite filter.

appliesTo

public boolean appliesTo(java.lang.String classname)
Always returns true.

Specified by:
appliesTo in interface InstrumentationFilter
Parameters:
classname - 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.

getInstrumentationLevel

public int getInstrumentationLevel(java.lang.String classname)
Get the instrumentation level for a class. This is determined by querying each filter in the composite filter. The instrumentation level given by the filter with the highest filter level is returned. If two or more filters tie in filter level, the one that was added to the composite last takes priority.

Specified by:
getInstrumentationLevel in interface InstrumentationFilter
Parameters:
classname - the name of the class to get the instrumentation level of.
Returns:
the instrumenation level, one of NONE, PRE, POST, and ALL. Returns NONE if there are no filters in the composite filter.

size

public int size()
Get the number of filters in this composite filter.


toString

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

Overrides:
toString in class java.lang.Object