KickJava   Java API By Example, From Geeks To Geeks.

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


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

5 package com.opensymphony.workflow.query;
6
7 import org.apache.commons.logging.Log;
8 import org.apache.commons.logging.LogFactory;
9
10 import java.io.Serializable JavaDoc;
11
12
13 /**
14  * @deprecated use {@link WorkflowExpressionQuery} instead
15  * @author $Author: hani $
16  * @version $Revision: 1.4 $
17  */

18 public class WorkflowQuery implements Serializable JavaDoc {
19     //~ Static fields/initializers /////////////////////////////////////////////
20

21     private static final Log log = LogFactory.getLog(WorkflowQuery.class);
22     public final static int EQUALS = 1;
23     public final static int LT = 2;
24     public final static int GT = 3;
25     public final static int BETWEEN = 4;
26     public final static int NOT_EQUALS = 5;
27     public final static int AND = 6;
28     public final static int OR = 7;
29     public final static int XOR = 8;
30     public final static int OWNER = 1;
31     public final static int START_DATE = 2;
32     public final static int FINISH_DATE = 3;
33     public final static int ACTION = 4;
34     public final static int STEP = 5;
35     public final static int CALLER = 6;
36     public final static int STATUS = 7;
37     public final static int HISTORY = 1;
38     public final static int CURRENT = 2;
39
40     //~ Instance fields ////////////////////////////////////////////////////////
41

42     private Object JavaDoc value;
43     private WorkflowQuery left;
44     private WorkflowQuery right;
45     private int field;
46     private int operator;
47     private int type;
48
49     //~ Constructors ///////////////////////////////////////////////////////////
50

51     public WorkflowQuery() {
52     }
53
54     public WorkflowQuery(WorkflowQuery left, int operator, WorkflowQuery right) {
55         this.operator = operator;
56         this.left = left;
57         this.right = right;
58     }
59
60     public WorkflowQuery(int field, int type, int operator, Object JavaDoc value) {
61         this.type = type;
62         this.operator = operator;
63         this.field = field;
64         this.value = value;
65     }
66
67     //~ Methods ////////////////////////////////////////////////////////////////
68

69     public int getField() {
70         return field;
71     }
72
73     public WorkflowQuery getLeft() {
74         return left;
75     }
76
77     public int getOperator() {
78         return operator;
79     }
80
81     public WorkflowQuery getRight() {
82         return right;
83     }
84
85     public int getType() {
86         int qtype = type;
87
88         if (qtype == 0) {
89             if (getLeft() != null) {
90                 qtype = getLeft().getType();
91             }
92         }
93
94         return qtype;
95     }
96
97     public Object JavaDoc getValue() {
98         return value;
99     }
100 }
101
Popular Tags