001: package org.odbms;
002:
003: /* Copyright 2002-2005 The Apache Software Foundation
004: *
005: * Licensed under the Apache License, Version 2.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: /**
019: * constraint for a single query node.
020: * <br><br>A Constraint is associated with one single <code>Query</code> node
021: * - a single member of a class.<br><br>
022: * Constraints are constructed by calling
023: * <a href="Query.html#constrain(java.lang.object)">
024: * <code>Query.constrain()</code></a>.
025: * <br><br>
026: * Constraints can be joined with the methods and() and or().<br><br>
027: * The following mutual exclusive functions set the evaluation mode.
028: * The subsequent call prevails:<br>
029: * identity(), equal(), greater(), greaterOrEqual(), smaller(),
030: * smallerOrEqual(), like(), contains()<br><br>
031: * is(), and not() are also mutually exclusive.<br><br>
032: */
033: public interface Constraint {
034:
035: /**
036: * links two Constraints for AND evaluation
037: * @param andWith the other Constraint
038: * @return a new Constraint, that can be used for further calls to and() and or()
039: */
040: public Constraint and(Constraint andWith);
041:
042: /**
043: * links two Constraints for OR evaluation
044: * @param orWith the other Constraint
045: * @return a new Constraint, that can be used for further calls to and() and or()
046: */
047: public Constraint or(Constraint orWith);
048:
049: /**
050: * sets the evaluation mode to "=="
051: * @return this Constraint to allow the chaining of method calls
052: */
053: public Constraint equal();
054:
055: /**
056: * sets the evaluation mode to ">"
057: * @return this Constraint to allow the chaining of method calls
058: */
059: public Constraint greater();
060:
061: /**
062: * sets the evaluation mode to ">="
063: * @return this Constraint to allow the chaining of method calls
064: */
065: public Constraint greaterOrEqual();
066:
067: /**
068: * sets the evaluation mode to "<"
069: * @return this Constraint to allow the chaining of method calls
070: */
071: public Constraint smaller();
072:
073: /**
074: * sets the evaluation mode to "<="
075: * @return this Constraint to allow the chaining of method calls
076: */
077: public Constraint smallerOrEqual();
078:
079: /**
080: * sets the evaluation mode to identity comparison
081: * @return this Constraint to allow the chaining of method calls
082: */
083: public Constraint identity();
084:
085: /**
086: * sets the evaluation mode to "like" comparison
087: * @return this Constraint to allow the chaining of method calls
088: */
089: public Constraint like();
090:
091: /**
092: * sets the evaluation mode to containment comparison
093: * @return this Constraint to allow the chaining of method calls
094: */
095: public Constraint contains();
096:
097: /**
098: * turns off not() comparison
099: * @return this Constraint to allow the chaining of method calls
100: */
101: public Constraint is();
102:
103: /**
104: * turns on not() comparison
105: * @return this Constraint to allow the chaining of method calls
106: */
107: public Constraint not();
108: }
|