KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > api > common > ResourceIteratorExpressionBuilder


1 /* ResourceIteratorExpressionBuilder.java */
2
3 package org.enhydra.shark.api.common;
4
5 import java.io.Serializable JavaDoc;
6
7 /**
8  * ResourceIteratorExpressionBuilder
9  * <p>
10  * All methods are returng the object itself to allow stacking method
11  * calls on the same object.
12  *
13  * @author V.Puskas
14  * @version 0.2
15  */

16 public interface ResourceIteratorExpressionBuilder extends
17                                                   ExpressionBuilder,
18                                                   Serializable JavaDoc {
19
20    /**
21     * Appends <b>AND </b> operator to expression
22     *
23     * @return itself
24     */

25    public abstract ResourceIteratorExpressionBuilder and();
26
27    /**
28     * Appends <b>OR </b> operator to expression
29     *
30     * @return itself
31     */

32    public abstract ResourceIteratorExpressionBuilder or();
33
34    /**
35     * Appends <b>NOT </b> operator to expression
36     *
37     * @return itself
38     */

39    public abstract ResourceIteratorExpressionBuilder not();
40
41    /**
42     * Appends condition "resources username == value of un"
43     *
44     * @param un
45     * @return itself
46     */

47    public abstract ResourceIteratorExpressionBuilder addUsernameEquals(String JavaDoc un);
48
49    /**
50     * Appends condition "resources assignments count == value of cnt"
51     *
52     * @param cnt
53     * @return itself
54     */

55    public abstract ResourceIteratorExpressionBuilder addAssignemtCountEquals(long cnt);
56
57    /**
58     * Appends condition "resources assignments count < value of cnt"
59     *
60     * @param cnt
61     * @return itself
62     */

63    public abstract ResourceIteratorExpressionBuilder addAssignemtCountLessThan(long cnt);
64
65    /**
66     * Appends condition "resources assignments count > value of cnt"
67     *
68     * @param cnt
69     * @return itself
70     */

71    public abstract ResourceIteratorExpressionBuilder addAssignemtCountGreaterThan(long cnt);
72
73    /**
74     * Appends arbitrary condition
75     * <p>
76     * Here you may specify any script compatible expression, but
77     * <b>beware complete expression will be evaluated inside Java VM
78     * </b>, not on DB.
79     *
80     * @param exp condition to add
81     * @return itself
82     */

83    public abstract ResourceIteratorExpressionBuilder addExpression(String JavaDoc exp);
84
85    /**
86     * Appends condition contained inside other
87     * <tt>ResourceIteratorExpressionBuilder</tt>. This allows user to
88     * build more complicated expressions, by insterting eb condition
89     * into parenthesis.
90     *
91     * @param eb
92     * @return itself
93     */

94    public abstract ResourceIteratorExpressionBuilder addExpression(ResourceIteratorExpressionBuilder eb);
95
96    /**
97     * Methods starting with <tt>setOrderBy</tt> obviously don't affect
98     * actual expression (nor its evaluation), rather they affect sorting
99     * of the result.
100     * <p>
101     * This method sets ordering by resource username name value.
102     *
103     * @param ascending
104     * @return itself
105     */

106    public abstract ResourceIteratorExpressionBuilder setOrderByUsername(boolean ascending);
107 }
Popular Tags