Source code: com/flexstor/common/data/ejb/search/AdvancedItemData.java
1 /*
2 * AdvancedItemData.java
3 *
4 * Copyright $Date: 2003/08/11 02:22:37 $ FLEXSTOR.net Inc.
5 *
6 * This work is licensed for use and distribution under license terms found at
7 * http://www.flexstor.org/license.html
8 *
9 */
10
11 package com.flexstor.common.data.ejb.search;
12
13 /**
14 * Data item for advanced search.
15 *
16 * Advanced search is of the form <p>
17 * bucket.field op1 value1 and/or(relation) bucket.field op2 value2 {And, only if not the last element}
18 */
19 public class AdvancedItemData
20 extends SearchCriteriaItemData
21 {
22 static final long serialVersionUID = -1062954247275275853L;
23 private int nBucketId;
24 private int nBucketType;
25 private int nFieldId;
26 private int nOperator1;
27 private String sValue1;
28 private int nOperator2;
29 private String sValue2;
30
31 public AdvancedItemData()
32 {
33 }
34
35 public AdvancedItemData ( int bucket, int bucketType, int field, int op1, String value1,
36 int op2, String value2, int relation)
37 {
38 setDisguiseBucket( bucket );
39 setBucketType( bucketType );
40 setDisguiseField( field );
41 setOp1( op1 );
42 setValue1( value1 );
43 setOp2( op2 );
44 setValue2( value2 );
45 super.setRelation( relation );
46 }
47
48 public int getDisguiseBucket()
49 {
50 return nBucketId;
51 }
52
53 public void setDisguiseBucket(int bucket)
54 {
55 nBucketId = bucket;
56 }
57
58 public int getDisguiseField()
59 {
60 return nFieldId;
61 }
62
63 public void setDisguiseField(int field)
64 {
65 nFieldId = field;
66 }
67
68 public int getOp1()
69 {
70 return nOperator1;
71 }
72
73 public void setOp1(int op)
74 {
75 nOperator1 = op;
76 }
77
78 public int getOp2()
79 {
80 return nOperator2;
81 }
82
83 public void setOp2(int op)
84 {
85 nOperator2 = op;
86 }
87
88
89
90 public String getValue1()
91 {
92 return sValue1;
93 }
94
95 public void setValue1(String value)
96 {
97 sValue1 = value;
98 }
99
100 public String getValue2()
101 {
102 return sValue2;
103 }
104
105 public void setValue2(String value)
106 {
107 sValue2 = value;
108 }
109
110 /**
111 * Set Bucket Type
112 *
113 * @param bucketType - these are defined in BucketConstantsI
114 * @see com.flexstor.common.constants.BucketConstantsI
115 */
116 public void setBucketType( int bucketType )
117 {
118 nBucketType = bucketType;
119 }
120
121 /**
122 * Get Bucket Type
123 *
124 * @return bucketType - these are defined in BucketConstantsI
125 * @see com.flexstor.common.constants.BucketConstantsI
126 */
127 public int getBucketType()
128 {
129 return nBucketType;
130 }
131 }