1
2
3
4
5
6
7
8 package com.buckosoft.PicMan.domain;
9
10 import java.text.DecimalFormat;
11
12 import org.apache.commons.logging.Log;
13 import org.apache.commons.logging.LogFactory;
14
15
16
17
18
19
20 public class ContactParams {
21 private static final boolean DEBUG = false;
22 protected final Log logger = LogFactory.getLog(getClass());
23
24 private int cid;
25 private String setName;
26 private int size;
27 private int rankMin;
28 private int rankMax;
29 private String engineName;
30
31 private String outputDirectory;
32 private int contactNumber;
33
34
35 public ContactParams() {}
36
37 public ContactParams(int cid, String setName, int size, int item) {
38 this.cid = cid;
39 this.setName = setName;
40 this.size = size;
41 this.contactNumber = item;
42 }
43 public ContactParams(SetSize setSize) {
44 setSetSize(setSize);
45 }
46
47
48
49
50
51
52
53
54 public boolean equals(ContactParams other) {
55 if (DEBUG)
56 logger.info("equals: " + this.setName + "/" + this.size + "/" + this.contactNumber + " : " + other.setName + "/" + other.size + "/" + other.contactNumber);
57 if (this.cid != other.cid)
58 return(false);
59 if (!this.setName.equals(other.setName))
60 return(false);
61 if (this.size == -1
62 || other.size == -1)
63 return(true);
64 if (this.size != other.size)
65 return(false);
66 if (this.contactNumber == -1
67 || other.contactNumber == -1)
68 return(true);
69 if (this.contactNumber == other.contactNumber)
70 return(true);
71 return(false);
72 }
73
74
75
76
77
78
79
80 public boolean equalsPics(ContactParams other) {
81 if (DEBUG)
82 logger.info("equals: " + this.setName + "/" + this.size + "/" + this.contactNumber + " : " + other.setName + "/" + other.size + "/" + other.contactNumber);
83 if (!this.setName.equals(other.setName))
84 return(false);
85 if (this.size != other.size)
86 return(false);
87 if (this.rankMin != other.rankMin)
88 return(false);
89 if (this.rankMax != other.rankMax)
90 return(false);
91 return(true);
92
93 }
94
95
96
97
98 public int getCid() {
99 return cid;
100 }
101
102
103
104
105 public void setCid(int cid) {
106 this.cid = cid;
107 }
108
109 public void setSetSize(SetSize setSize) {
110 this.setName = setSize.getSetName();
111 this.size = setSize.getSize();
112 }
113
114 public String getSetName() {
115 return setName;
116 }
117 public void setSetName(String setName) {
118 this.setName = setName;
119 }
120
121
122
123
124 public int getSize() {
125 return size;
126 }
127
128
129
130
131 public void setSize(int size) {
132 this.size = size;
133 }
134
135 public String getOutputDirectory() {
136 return outputDirectory;
137 }
138 public void setOutputDirectory(String outputDirectory) {
139 this.outputDirectory = outputDirectory;
140 }
141 public int getContactNumber() {
142 return contactNumber;
143 }
144 public void setContactNumber(int contactNumber) {
145 this.contactNumber = contactNumber;
146 }
147
148 private static DecimalFormat df2 = new DecimalFormat("00");
149 private static DecimalFormat df3 = new DecimalFormat("000");
150
151
152
153 public String getUuid() {
154 return(new String(getSetName()
155 + "-" + df3.format(getSize())
156 + "-" + df2.format(getContactNumber())));
157 }
158
159
160
161
162 public String getUid() {
163 DecimalFormat df3 = new DecimalFormat("000");
164 return(new String(getSetName()
165 + "-" + df3.format(getSize())));
166 }
167
168
169
170
171 public int getRankMax() {
172 return rankMax;
173 }
174
175
176
177
178 public void setRankMax(int rankMax) {
179 this.rankMax = rankMax;
180 }
181
182
183
184
185 public int getRankMin() {
186 return rankMin;
187 }
188
189
190
191
192 public void setRankMin(int rankMin) {
193 this.rankMin = rankMin;
194 }
195
196
197
198
199
200
201 public void setRankMinMax(int min, int max) {
202 this.rankMin = min;
203 this.rankMax = max;
204 }
205
206
207
208
209 public String getEngineName() {
210 return engineName;
211 }
212
213
214
215
216 public void setEngineName(String engineName) {
217 this.engineName = engineName;
218 }
219
220 }