Source code: com/pjsofts/eurobudget/beans/FileData.java
1 /*
2 * FileData.java
3 *
4 * Created on 10 janvier 2002, 21:33
5 */
6
7 package com.pjsofts.eurobudget.beans;
8
9 import java.io.Serializable;
10 import java.util.*;
11
12 /**
13 * Bean Standard.
14 * Main object which contains all information for an EuroBudget sesssion.
15 * It is the object which is saved into file through serialization.
16 * Should minimize all changes to this class as it may breaks its persistence
17 * (serial uid of the class will change and old files could'nt be load again)
18 *
19 * Note on xml encoding/decoding:seems to fail on ArrayList;SortedSet and some others !
20 * @author Standard
21 */
22 public class FileData implements Serializable {
23 private static final long serialVersionUID = 4623447909160012554L;
24
25 public static final String FILE_STAMP = "EuroBudget";
26
27 /** may be usefull later on (not static to be saved with other fields)*/
28 public final int FILE_VERSION = 1;
29
30 // may be used later on:
31 /** @serial */
32 private Date lastModifyDate;
33 /** @serial */
34 private String lastModifyUser;
35 /** @serial */
36 private Date lastAccessDate;
37 /** @serial */
38 private String lastAccessUser;
39 /** @serial */
40 private Date creationDate;
41 /** @serial */
42 private String creationUser;
43
44 /** @serial hint to help user remember his password */
45 private String passwordHint;
46
47 /** Doer of this account
48 * @serial
49 */
50 private Entity owner;
51 /** All account of the owner
52 * @serial
53 */
54 // keep Vector rather than Account[] cause it's easier to link it with comboboxmodel
55 private Vector accounts;
56 /** All entities
57 * @serial
58 */
59 private Vector entities;
60 /** All banks
61 * @serial
62 */
63 private Vector banks;
64
65 /** All categories SortedMap(key:Category) of List//SortedSet of Categories
66 * @serial
67 */
68 private SortedMap costCategories;
69 /** All categories SortedMap(key:Category) of SortedSet//ArrayList of Categories
70 * @serial
71 */
72 private SortedMap revenueCategories;
73 /** All categories SortedMap(key:Category) of SortedSet//ArrayList of Categories */
74 // private SortedMap specialCategories;//SortedMap specialCategories;
75 //or List of CategoryPair ??
76
77 /** group of ctg, Items: CategoryGroup , no more Set to allow better serialization in xml
78 * @serial
79 */
80 private CategoryGroup[] categoryGroups;
81
82 /** @serial */
83 private AccountGroup[] accountGroups;
84
85 /** @serial */
86 private TypeOfGood[] goodTypes;
87
88 /** List of Goods
89 * @serial
90 */
91 private List goods;
92
93 /** Preferences */
94 /** columns displayed in Txn Editor */
95 // private int[] txnEditorColumns;
96
97 /**
98 * List of Impots
99 * Impots (not report, but what has been set and predictions of what we will pay)
100 * Depend of the country also.
101 * country decide what kind of class for entry, choices, baremes and results
102 * all may have global interface independant of country (display result)
103 * 1 or 2 per user and per year, may do more to simulate many situation:
104 * Key: user+name+year
105 * Sort on date again
106 * Need to separate:
107 * entry data (amount), choices of user (frais réel ou 10%, etc ...), Bareme of the year, Result (mensuel,year,..).
108 */
109 private transient List impots;// transient cause not yet ok for serialization
110
111 /** List of PeriodicTxn */
112 private transient List periodicTxns;// transient cause not yet ok for serialization
113
114 /** List of ReportSaved Saved reports */
115 private transient List savedReports; // transient cause not yet ok for serialization
116
117
118 /** Creates a new instance of FileData */
119 public FileData() {
120 }
121
122 /** Getter for property owner.
123 * @return Value of property owner.
124 */
125 public com.pjsofts.eurobudget.beans.Entity getOwner() {
126 return owner;
127 }
128
129 /** Setter for property owner.
130 * @param owner New value of property owner.
131 */
132 public void setOwner(com.pjsofts.eurobudget.beans.Entity owner) {
133 this.owner = owner;
134 }
135
136 /** Getter for property accounts.
137 * @return Value of property accounts.
138 */
139 public Vector getAccounts() {
140 return this.accounts;
141 }
142
143 /** Setter for property accounts.
144 * @param accounts New value of property accounts.
145 */
146 public void setAccounts(Vector accounts) {
147 this.accounts = accounts;
148 }
149
150 /** Getter for property entities.
151 * @return Value of property entities.
152 */
153 public Vector getEntities() {
154 return this.entities;
155 }
156
157 /** Setter for property entities.
158 * @param entities New value of property entities.
159 */
160 public void setEntities(Vector entities) {
161 this.entities = entities;
162 }
163
164 /** Getter for property banks.
165 * @return Value of property banks.
166 */
167 public Vector getBanks() {
168 return this.banks;
169 }
170
171 /** Setter for property banks.
172 * @param banks New value of property banks.
173 */
174 public void setBanks(Vector banks) {
175 this.banks = banks;
176 }
177
178 // /** Getter for property categories.
179 // * @return Value of property categories.
180 // */
181 // public TreeMap getCategories() {
182 // return categories;
183 // }
184 //
185 // /** Setter for property categories.
186 // * @param categories New value of property categories.
187 // */
188 // public void setCategories(TreeMap categories) {
189 // this.categories = categories;
190 // }
191
192 /** Getter for property costCategories.
193 * @return Value of property costCategories.
194 */
195 public SortedMap getCostCategories() {
196 return costCategories;
197 }
198
199 /** Setter for property costCategories.
200 * @param costCategories New value of property costCategories.
201 */
202 public void setCostCategories(SortedMap costCategories) {
203 this.costCategories = costCategories;
204 }
205
206 /** Getter for property revenueCategories.
207 * @return Value of property revenueCategories.
208 */
209 public SortedMap getRevenueCategories() {
210 return revenueCategories;
211 }
212
213 /** Setter for property revenueCategories.
214 * @param revenueCategories New value of property revenueCategories.
215 */
216 public void setRevenueCategories(SortedMap revenueCategories) {
217 this.revenueCategories = revenueCategories;
218 }
219
220 // /** Getter for property specialCategories.
221 // * @return Value of property specialCategories.
222 // */
223 // public java.util.SortedMap getSpecialCategories() {
224 // return specialCategories;
225 // }
226 //
227 // /** Setter for property specialCategories.
228 // * @param specialCategories New value of property specialCategories.
229 // */
230 // public void setSpecialCategories(java.util.SortedMap specialCategories) {
231 // this.specialCategories = specialCategories;
232 // }
233
234 /** Getter for property categoryGroups.
235 * @return Value of property categoryGroups.
236 */
237 public com.pjsofts.eurobudget.beans.CategoryGroup[] getCategoryGroups() {
238 return categoryGroups;
239 }
240
241 /** Setter for property categoryGroups.
242 * @param categoryGroups New value of property categoryGroups.
243 */
244 public void setCategoryGroups(com.pjsofts.eurobudget.beans.CategoryGroup[] categoryGroups) {
245 this.categoryGroups = categoryGroups;
246 }
247
248 /** Getter for property goodTypes.
249 * @return Value of property goodTypes.
250 */
251 public com.pjsofts.eurobudget.beans.TypeOfGood[] getGoodTypes() {
252 return this.goodTypes;
253 }
254
255 /** Setter for property goodTypes.
256 * @param goodTypes New value of property goodTypes.
257 */
258 public void setGoodTypes(com.pjsofts.eurobudget.beans.TypeOfGood[] goodTypes) {
259 this.goodTypes = goodTypes;
260 }
261
262 /** Getter for property goods.
263 * @return Value of property goods.
264 */
265 public List getGoods() {
266 return goods;
267 }
268
269 /** Setter for property goods.
270 * @param goods New value of property goods.
271 */
272 public void setGoods(List goods) {
273 this.goods = goods;
274 }
275
276 /** Getter for property lastAccessDate.
277 * @return Value of property lastAccessDate.
278 */
279 public Date getLastAccessDate() {
280 return lastAccessDate;
281 }
282
283 /** Setter for property lastAccessDate.
284 * @param lastAccessDate New value of property lastAccessDate.
285 */
286 public void setLastAccessDate(Date lastAccessDate) {
287 this.lastAccessDate = lastAccessDate;
288 }
289
290 /** Getter for property lastAccessUser.
291 * @return Value of property lastAccessUser.
292 */
293 public java.lang.String getLastAccessUser() {
294 return lastAccessUser;
295 }
296
297 /** Setter for property lastAccessUser.
298 * @param lastAccessUser New value of property lastAccessUser.
299 */
300 public void setLastAccessUser(java.lang.String lastAccessUser) {
301 this.lastAccessUser = lastAccessUser;
302 }
303
304 /** Getter for property lastModifyDate.
305 * @return Value of property lastModifyDate.
306 */
307 public Date getLastModifyDate() {
308 return lastModifyDate;
309 }
310
311 /** Setter for property lastModifyDate.
312 * @param lastModifyDate New value of property lastModifyDate.
313 */
314 public void setLastModifyDate(Date lastModifyDate) {
315 this.lastModifyDate = lastModifyDate;
316 }
317
318 /** Getter for property lastModifyUser.
319 * @return Value of property lastModifyUser.
320 */
321 public java.lang.String getLastModifyUser() {
322 return lastModifyUser;
323 }
324
325 /** Setter for property lastModifyUser.
326 * @param lastModifyUser New value of property lastModifyUser.
327 */
328 public void setLastModifyUser(java.lang.String lastModifyUser) {
329 this.lastModifyUser = lastModifyUser;
330 }
331
332 /** Getter for property creationDate.
333 * @return Value of property creationDate.
334 */
335 public Date getCreationDate() {
336 return creationDate;
337 }
338
339 /** Setter for property creationDate.
340 * @param creationDate New value of property creationDate.
341 */
342 public void setCreationDate(Date creationDate) {
343 this.creationDate = creationDate;
344 }
345
346 /** Getter for property creationUser.
347 * @return Value of property creationUser.
348 */
349 public java.lang.String getCreationUser() {
350 return creationUser;
351 }
352
353 /** Setter for property creationUser.
354 * @param creationUser New value of property creationUser.
355 */
356 public void setCreationUser(java.lang.String creationUser) {
357 this.creationUser = creationUser;
358 }
359
360 /** Getter for property periodicTxns.
361 * @return Value of property periodicTxns.
362 */
363 public List getPeriodicTxns() {
364 return periodicTxns;
365 }
366
367 /** Setter for property periodicTxns.
368 * @param periodicTxns New value of property periodicTxns.
369 */
370 public void setPeriodicTxns(List periodicTxns) {
371 this.periodicTxns = periodicTxns;
372 }
373
374 /** Getter for property impots.
375 * @return Value of property impots.
376 */
377 public List getImpots() {
378 return impots;
379 }
380
381 /** Setter for property impots.
382 * @param impots New value of property impots.
383 */
384 public void setImpots(List impots) {
385 this.impots = impots;
386 }
387
388 /** Getter for property savedReports.
389 * @return Value of property savedReports.
390 */
391 public List getSavedReports() {
392 return savedReports;
393 }
394
395 /** Setter for property savedReports.
396 * @param savedReports New value of property savedReports.
397 */
398 public void setSavedReports(List savedReports) {
399 this.savedReports = savedReports;
400 }
401
402 /** Getter for property passwordHint.
403 * @return Value of property passwordHint.
404 *
405 */
406 public java.lang.String getPasswordHint() {
407 return passwordHint;
408 }
409
410 /** Setter for property passwordHint.
411 * @param passwordHint New value of property passwordHint.
412 *
413 */
414 public void setPasswordHint(java.lang.String passwordHint) {
415 this.passwordHint = passwordHint;
416 }
417
418 }
419