Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/odbms/Constraint.java


1   /*
2    * Original source: http://www.odbms.org
3    */
4   
5   
6   package  org.odbms;
7   
8   
9   /**
10   * constraint for a single query node.  
11   * <br><br>A Constraint is associated with one single <code>Query</code> node 
12   * - a single member of a class.<br><br>
13   * Constraints are constructed by calling 
14   * <a href="Query.html#constrain(java.lang.object)">
15   * <code>Query.constrain()</code></a>.
16   * <br><br>
17   * Constraints can be joined with the methods and() and or().<br><br>
18   * The following mutual exclusive functions set the evaluation mode.
19   * The subsequent call prevails:<br>
20   * identity(), equal(), greater(), greaterOrEqual(), smaller(), 
21   * smallerOrEqual(), like(), contains()<br><br>
22   * is(), and not() are also mutually exclusive.<br><br>
23   */
24  public interface Constraint {
25  
26      /**
27     * links two Constraints for AND evaluation
28       * @param andWith the other Constraint
29       * @return a new Constraint, that can be used for further calls to and() and or()
30       */
31      public Constraint and (Constraint andWith);
32  
33  
34  
35      /**
36     * links two Constraints for OR evaluation
37       * @param orWith the other Constraint
38       * @return a new Constraint, that can be used for further calls to and() and or()
39       */
40      public Constraint or (Constraint orWith);
41  
42  
43  
44      /**
45       * sets the evaluation mode to "=="
46       * @return this Constraint to allow the chaining of method calls
47       */
48      public Constraint equal ();
49  
50  
51  
52      /**
53       * sets the evaluation mode to ">"
54       * @return this Constraint to allow the chaining of method calls
55       */
56      public Constraint greater ();
57  
58  
59  
60      /**
61       * sets the evaluation mode to ">="
62       * @return this Constraint to allow the chaining of method calls
63       */
64      public Constraint greaterOrEqual ();
65  
66  
67  
68      /**
69       * sets the evaluation mode to "<"
70       * @return this Constraint to allow the chaining of method calls
71       */
72      public Constraint smaller ();
73  
74  
75  
76      /**
77       * sets the evaluation mode to "<="
78       * @return this Constraint to allow the chaining of method calls
79       */
80      public Constraint smallerOrEqual ();
81  
82  
83      /**
84       * sets the evaluation mode to identity comparison
85       * @return this Constraint to allow the chaining of method calls
86       */
87      public Constraint identity ();
88    
89    
90      /**
91       * sets the evaluation mode to "like" comparison
92       * @return this Constraint to allow the chaining of method calls
93       */
94      public Constraint like ();
95    
96    
97      /**
98       * sets the evaluation mode to containment comparison
99       * @return this Constraint to allow the chaining of method calls
100      */
101     public Constraint contains ();
102 
103 
104     /**
105      * turns off not() comparison
106      * @return this Constraint to allow the chaining of method calls
107      */
108     public Constraint is ();
109 
110 
111 
112     /**
113      * turns on not() comparison
114      * @return this Constraint to allow the chaining of method calls
115      */
116     public Constraint not ();
117 }
118