LesserEqualPredicate.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$
15  */
16 package gate.jape.constraint;
17 
18 import gate.jape.JapeException;
19 
20 public class LesserEqualPredicate extends ComparablePredicate {
21 
22   public String getOperator() {
23     return LESSER_OR_EQUAL;
24   }
25 
26   /**
27    * Check if passed value is less than or equal to stored value using
28    {@link Comparable} operations. Will attempt to do basic type
29    * conversion between the values. Returns false if passed value is
30    * null.
31    */
32   protected boolean doMatch(Object annotValuethrows JapeException {
33     return compareValue(annotValue>= 0;
34   }
35 
36 }