KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > query > WorkflowExpressionQuery


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.workflow.query;
6
7 import java.io.Serializable JavaDoc;
8
9
10 /**
11  * Workflow Query.
12  * A workflow expression-based query is constructed by specifying a number of expressions in the query.
13  * Currently queries can only have one operator act on them. Either the expressions are either evaluated
14  * with an OR, whereby the first expression that passes results in inclusion of a result, or with an AND,
15  * whereby all expressions must return true for a result to be included.
16  *
17  * @author Christine Zimmermann
18  * @version $Revision: 1.7 $
19  */

20 public class WorkflowExpressionQuery implements Serializable JavaDoc {
21     //~ Static fields/initializers /////////////////////////////////////////////
22

23     public static final int SORT_NONE = 0;
24     public static final int SORT_ASC = 1;
25     public static final int SORT_DESC = -1;
26
27     //~ Instance fields ////////////////////////////////////////////////////////
28

29     private Expression expression = null;
30     private int orderBy;
31     private int sortOrder;
32
33     //~ Constructors ///////////////////////////////////////////////////////////
34

35     public WorkflowExpressionQuery() {
36     }
37
38     /**
39      * Create a WorkflowExpressionQuery that consists of one expression.
40      */

41     public WorkflowExpressionQuery(Expression expression) {
42         this.expression = expression;
43     }
44
45     //~ Methods ////////////////////////////////////////////////////////////////
46

47     public Expression getExpression() {
48         return expression;
49     }
50
51     public void setOrderBy(int orderBy) {
52         this.orderBy = orderBy;
53     }
54
55     public int getOrderBy() {
56         return orderBy;
57     }
58
59     public void setSortOrder(int sortOrder) {
60         this.sortOrder = sortOrder;
61     }
62
63     public int getSortOrder() {
64         return sortOrder;
65     }
66 }
67
Popular Tags