KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > storage > search > FieldCompareConstraint


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.storage.search;
11
12 /**
13  * A constraint that compares a stepfield value with another value.
14  * <p>
15  * This corresponds with comparison operators <, =, > and LIKE in SQL SELECT-syntax.
16  *
17  * @author Rob van Maris
18  * @version $Id: FieldCompareConstraint.java,v 1.4 2005/04/25 14:56:57 pierre Exp $
19  * @since MMBase-1.7
20  */

21 public interface FieldCompareConstraint extends FieldConstraint {
22
23     /** Operator 'less than' */
24     public final static int LESS = 1;
25     /** Operator 'less than or equal' */
26     public final static int LESS_EQUAL = 2;
27     /** Operator 'equal' */
28     public final static int EQUAL = 3;
29     /** Operator 'not equal' */
30     public final static int NOT_EQUAL = 4;
31     /** Operator 'greater than' */
32     public final static int GREATER = 5;
33     /** Operator 'greater than or equal' */
34     public final static int GREATER_EQUAL = 6;
35     /** Operator 'like' */
36     public final static int LIKE = 7;
37
38     /**
39      * Operator descriptions corresponding to the operator values:
40      * {@link #LESS}, {@link #LESS_EQUAL}, {@link #EQUAL}, {@link #NOT_EQUAL},
41      * {@link #GREATER}, {@link #GREATER_EQUAL}, and {@link #LIKE}
42      */

43     public final static String JavaDoc[] OPERATOR_DESCRIPTIONS = new String JavaDoc[] {
44         null, // not specified
45
"less than", "less than or equal", "equal", "not equal",
46          "greater than", "greater than or equal", "like"
47     };
48
49     /**
50      * Gets the operator used to compare values.
51      * This must be one of the values declared here.
52      * The value <code>LIKE</code> is allowed only when the associated field
53      * is of string type.
54      */

55     int getOperator();
56 }
57
Popular Tags