org.geotoolkit.util.converter
Class BaseClassFilter

Object
  extended by BaseClassFilter
All Implemented Interfaces:
Serializable, ClassFilter

public class BaseClassFilter
extends Object
implements ClassFilter, Serializable

A Class Filter implementation accepting only classes that are assignable to a given base class.

Since:
3.00
Version:
3.00
Author:
Martin Desruisseaux (Geomatys)
See Also:
Serialized Form
Module:
utility/geotk-utility (download)    View source code for this class

Field Summary
protected  Class<?> base
          The base class.
 
Fields inherited from interface ClassFilter
CHAR_SEQUENCE, NUMBER
 
Constructor Summary
BaseClassFilter(Class<?> base)
          Creates a new class filter for the given base.
 
Method Summary
 boolean accepts(Class<?> type)
          Returns true if the given type is assignable to the base class.
 ClassFilter negate()
          Returns a filter which is the negation of this filter.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base

protected final Class<?> base
The base class.

Constructor Detail

BaseClassFilter

public BaseClassFilter(Class<?> base)
Creates a new class filter for the given base.

Parameters:
base - The base class.
Method Detail

accepts

public boolean accepts(Class<?> type)
Returns true if the given type is assignable to the base class.

Specified by:
accepts in interface ClassFilter
Parameters:
type - The class to test.
Returns:
true if the given class can be accepted.

negate

public ClassFilter negate()
Returns a filter which is the negation of this filter. With the default implementation of accepts(java.lang.Class) method, it is a filter accepting any class that are not assignable to the base class.

Specified by:
negate in interface ClassFilter
Returns:
The negation of this filter.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.