01 /*
02 * Created on Oct 4, 2007
03 */
04 package com.x8ing.mc.bp;
05
06 /**
07 * A money transaction must belong to a certain account. This allows detailed financial analysis where the money has
08 * been spend or gained respectively.
09 *
10 * Use the static final class members as accounts.
11 *
12 * @author Patrick Heusser
13 */
14 public class BalanceAccount {
15
16 private String name = null;
17
18 private String description = null;
19
20 private BalanceAccount(String name, String description) {
21 this.name = name;
22 this.description = description;
23 }
24
25 /**
26 * keeps track of production process gain, and outages
27 */
28 public static final BalanceAccount PRODUCTION = new BalanceAccount("Production",
29 "keeps track of production process gain an outages");
30
31 /**
32 * bug analyzing costs
33 */
34 public static final BalanceAccount BUG_ANALYZING = new BalanceAccount("BugAnalyzing", "keeps track of bug analyzing costs");
35
36 /**
37 * develop and fix later costs
38 */
39 public static final BalanceAccount DEVELOP = new BalanceAccount("Development", "keeps track of fixing and fix-later cost");
40
41 /**
42 * testing cost
43 */
44 // SPACE at end for formatting
45 public static final BalanceAccount TESTING = new BalanceAccount("Testing ", "keeps track of testing cost");
46
47 /**
48 * deployment, release and documentation cost.
49 */
50 public static final BalanceAccount DEPLOYMENT = new BalanceAccount("Deployment",
51 "keeps track of deployment and releasing cost.");
52
53 public boolean equals(Object obj) {
54
55 if (obj == null || !(obj instanceof BalanceAccount)) {
56 return false;
57 }
58
59 BalanceAccount account2 = (BalanceAccount) obj;
60
61 return account2.getName().equals(this.getName());
62
63 }
64
65 public int hashCode() {
66
67 return getName().hashCode();
68
69 }
70
71 public String toString() {
72
73 return "BalanceAccount: name=" + name + " description=" + description;
74 }
75
76 public String getDescription() {
77 return description;
78 }
79
80 public String getName() {
81 return name;
82 }
83 }
|