1
2
3
4 package net.sourceforge.pmd.util.filter;
5
6
7
8
9
10
11
12 public class AndFilter<T> extends AbstractCompoundFilter<T> {
13
14 public AndFilter() {
15 super();
16 }
17
18 public AndFilter(Filter<T>... filters) {
19 super(filters);
20 }
21
22 public boolean filter(T obj) {
23 boolean match = true;
24 for (Filter<T> filter : filters) {
25 if (!filter.filter(obj)) {
26 match = false;
27 break;
28 }
29 }
30 return match;
31 }
32
33 @Override
34 protected String getOperator() {
35 return "and";
36 }
37 }