1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.archive.crawler.deciderules;
26
27
28 /***
29 * Rule applies configured decision to any URIs which do *not*
30 * match the supplied regexp.
31 *
32 * @author gojomo
33 */
34 public class NotMatchesRegExpDecideRule extends MatchesRegExpDecideRule {
35
36 private static final long serialVersionUID = -2085313401991694306L;
37
38
39
40
41 /***
42 * Usual constructor.
43 * @param name
44 */
45 public NotMatchesRegExpDecideRule(String name) {
46 super(name);
47 setDescription("NotMatchesRegExpDecideRule. Applies the configured " +
48 "decision to URIs *not* matching the supplied regular expression.");
49 }
50
51 /***
52 * Evaluate whether given object's string version does not match
53 * configured regexp (by reversing the superclass's answer).
54 *
55 * @param object Object to make decision about.
56 * @return true if the regexp is not matched
57 */
58 protected boolean evaluate(Object object) {
59 return ! super.evaluate(object);
60 }
61 }