1
2
3
4
5
6
7
8 package com.buckosoft.PicMan.domain;
9
10 import java.io.Serializable;
11 import java.util.Iterator;
12 import java.util.LinkedList;
13 import java.util.List;
14
15
16
17
18
19
20 public class Chain implements Serializable, DataStrings {
21 private static final long serialVersionUID = 1L;
22
23 private int cid = -1;
24 private String name;
25 private String shortName = "";
26 private String contactPrefix = "";
27 private String description = "";
28 private boolean active = false;
29 private String engine = "";
30 private String contactDirectory = "";
31 private int contactCount = 4;
32 private int contactWidth = 640;
33 private int contactHeight = 480;
34 private int picSelector = PICSELECTOR_SORT;
35 private int ratingMin = 1;
36 private int ratingMax = 9;
37 private boolean showUnusedSets = true;
38
39 private LinkedList<SetSize> setSizes = new LinkedList<SetSize>();
40
41 public void setName(String name) { this.name = name; }
42 public String getName() { return(name); }
43
44 public void setDescription(String desc) { this.description = desc; }
45 public String getDescription() { return(description); }
46
47
48
49
50
51 public int getCid() {
52 return cid;
53 }
54
55
56
57 public void setCid(int cid) {
58 this.cid = cid;
59 }
60
61
62
63
64 public String getShortName() {
65 return shortName;
66 }
67
68
69
70 public void setShortName(String shortName) {
71 this.shortName = shortName;
72 }
73
74
75
76
77 public boolean isActive() {
78 return active;
79 }
80
81
82
83 public void setActive(boolean active) {
84 this.active = active;
85 }
86
87 public String getContactPrefix() { return(contactPrefix); }
88 public void setContactPrefix(String contactPrefix) { this.contactPrefix = contactPrefix; }
89
90
91 public int getContactCount() {
92 return contactCount;
93 }
94 public void setContactCount(int contactCount) {
95 this.contactCount = contactCount;
96 }
97 public String getContactDirectory() {
98 return contactDirectory;
99 }
100 public void setContactDirectory(String contactDirectory) {
101 this.contactDirectory = contactDirectory;
102 }
103 public int getContactHeight() {
104 return contactHeight;
105 }
106 public void setContactHeight(int contactHeight) {
107 this.contactHeight = contactHeight;
108 }
109 public int getContactWidth() {
110 return contactWidth;
111 }
112 public void setContactWidth(int contactWidth) {
113 this.contactWidth = contactWidth;
114 }
115 public String getEngine() {
116 return engine;
117 }
118 public void setEngine(String engine) {
119 this.engine = engine;
120 }
121 public LinkedList<SetSize> getSetSizes() {
122 return setSizes;
123 }
124
125 public void addSetSize(SetSize ss) {
126 setSizes.add(ss);
127 }
128 public void setSetSizes(LinkedList<SetSize> setSizes) {
129 this.setSizes = setSizes;
130 }
131
132
133
134
135 public List<String> getSetNames() {
136 LinkedList<String> theList = new LinkedList<String>();
137 Iterator<SetSize> iter = this.setSizes.iterator();
138 while (iter.hasNext()) {
139 SetSize ss = (SetSize)iter.next();
140 boolean match = false;
141 Iterator<String> iterThe = theList.iterator();
142 while (iterThe.hasNext()) {
143 String s = (String)iterThe.next();
144 if (s.equals(ss.getSetName())) {
145 match = true;
146 break;
147 }
148 }
149 if (match == false) {
150 theList.add(ss.getSetName());
151 }
152 }
153 return(theList);
154 }
155
156
157
158
159 public boolean hasSetSize(String setName, int size) {
160 Iterator<SetSize> iter = this.setSizes.iterator();
161 while (iter.hasNext()) {
162 SetSize ss = (SetSize)iter.next();
163 if (ss.getSetName().equals(setName) && ss.getSize() == size)
164 return(true);
165 }
166 return(false);
167 }
168
169
170
171
172 public int getPicSelector() {
173 return picSelector;
174 }
175
176
177
178
179 public void setPicSelector(int picSelector) {
180 this.picSelector = picSelector;
181 }
182
183
184
185
186 public int getRatingMax() {
187 return ratingMax;
188 }
189
190
191
192
193 public void setRatingMax(int ratingMax) {
194 this.ratingMax = ratingMax;
195 }
196
197
198
199
200 public int getRatingMin() {
201 return ratingMin;
202 }
203
204
205
206
207 public void setRatingMin(int ratingMin) {
208 this.ratingMin = ratingMin;
209 }
210
211
212
213
214 public boolean isShowUnusedSets() {
215 return showUnusedSets;
216 }
217
218
219
220 public void setShowUnusedSets(boolean showUnusedSets) {
221 this.showUnusedSets = showUnusedSets;
222 }
223
224
225 }