NotRegExpMatchPredicate.java
01 /*
02  *  Constraint Predicate implementation
03  *
04  *  Copyright (c) 1995-2010, The University of Sheffield. See the file
05  *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
06  *
07  *  This file is part of GATE (see http://gate.ac.uk/), and is free
08  *  software, licenced under the GNU Library General Public License,
09  *  Version 2, June 1991 (in the distribution as file licence.html,
10  *  and also available at http://gate.ac.uk/gate/licence.html).
11  *
12  *  Eric Sword, 03/09/08
13  *
14  *  $Id: NotRegExpMatchPredicate.java 12006 2009-12-01 17:24:28Z thomas_heitz $
15  */
16 package gate.jape.constraint;
17 
18 import java.util.regex.Matcher;
19 
20 /**
21  * Implementation of the !=~ predicate, which fails if the entire
22  * annotation value matches the given regular expression, and succeeds
23  * otherwise.
24  */
25 public class NotRegExpMatchPredicate extends AbstractRegExpPredicate {
26 
27   @Override
28   protected boolean matcherResult(Matcher m) {
29     return !m.matches();
30   }
31 
32   public String getOperator() {
33     return NOT_REGEXP_MATCH;
34   }
35 
36 }