View Javadoc

    1   package net.sourceforge.pmd.util.filter;
    2
    3   /**
    4    * A logical NEGATION of a Filter.
    5    *
    6    * @param <T>
    7    *            The underlying type on which the filter applies.
    8    */
    9   public class NotFilter<T> extends AbstractDelegateFilter<T> {
    10  	public NotFilter() {
    11  		super();
    12  	}
    13
    14  	public NotFilter(Filter<T> filter) {
    15  		super(filter);
    16  	}
    17
    18  	public boolean filter(T obj) {
    19  		return !filter.filter(obj);
    20  	}
    21
    22  	public String toString() {
    23  		return "not (" + filter + ")";
    24  	}
    25  }