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