01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
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[] OPERATOR_DESCRIPTIONS = new String[] {
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: * Gets the operator used to compare values.
50: * This must be one of the values declared here.
51: * The value <code>LIKE</code> is allowed only when the associated field
52: * is of string type.
53: */
54: int getOperator();
55: }
|