org.clapper.util.classutil
Class NotClassFilter

java.lang.Object
  extended by org.clapper.util.classutil.NotClassFilter
All Implemented Interfaces:
ClassFilter

public class NotClassFilter
extends java.lang.Object
implements ClassFilter

NotClassFilter is a ClassFilter that wraps another ClassFilter and negates the sense of the wrapped filter's accept() method. This class conceptually provides a logical "NOT" operator for class name filters. For example, the following code fragment will create a filter that finds all classes that are not interfaces.

 NotClassFilter filter = new NotClassFilter (new InterfaceOnlyClassFilter());
 

Version:
$Revision: 6735 $
Author:
Copyright © 2006 Brian M. Clapper
See Also:
ClassFilter, AndClassFilter, OrClassFilter, ClassFinder, InterfaceOnlyClassFilter

Constructor Summary
NotClassFilter(ClassFilter filter)
          Create a new NotClassFilter that wraps the specified ClassFilter.
 
Method Summary
 boolean accept(ClassInfo classInfo, ClassFinder classFinder)
          Tests whether a class name should be included in a class name list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotClassFilter

public NotClassFilter(ClassFilter filter)
Create a new NotClassFilter that wraps the specified ClassFilter.

Parameters:
filter - The ClassFilter to wrap.
Method Detail

accept

public boolean accept(ClassInfo classInfo,
                      ClassFinder classFinder)
Tests whether a class name should be included in a class name list.

Specified by:
accept in interface ClassFilter
Parameters:
classInfo - the ClassInfo object to test
classFinder - the invoking ClassFinder object
Returns:
true if and only if the name should be included in the list; false otherwise


Copyright © 2004-2007 Brian M. Clapper. All Rights Reserved.