KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > za > org > coefficient > statistics > data > ModuleStatisticsData


1 /*
2  * Coefficient - facilitates project based collaboration
3  * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
4  * PO Box 395
5  * Pretoria 0001, RSA
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package za.org.coefficient.statistics.data;
21
22 /**
23  * @hibernate.class
24  * table="COEFFICIENT_MODULE_STATISTICS_DATA"
25  */

26 public class ModuleStatisticsData implements java.io.Serializable JavaDoc {
27     //~ Instance fields ========================================================
28

29     private Long JavaDoc id;
30     private long carryOverCompleteCount;
31     private long carryOverCreateCount;
32     private long carryOverUpdateCount;
33     private long completeCount;
34     private long createCount;
35     private long updateCount;
36
37     //~ Constructors ===========================================================
38

39     public ModuleStatisticsData() {
40     }
41
42     //~ Methods ================================================================
43

44     /**
45      * Sets the value of carryOverCompleteCount
46      *
47      * @param argCarryOverCompleteCount Value to assign to this.carryOverCompleteCount
48      */

49     public void setCarryOverCompleteCount(long argCarryOverCompleteCount) {
50         this.carryOverCompleteCount = argCarryOverCompleteCount;
51     }
52
53     /**
54      * Gets the value of carryOverCompleteCount
55      *
56      * @return the value of carryOverCompleteCount
57      * @hibernate.property
58      * column="CARRY_OVER_COMPLETE_COUNT"
59      */

60     public long getCarryOverCompleteCount() {
61         return this.carryOverCompleteCount;
62     }
63
64     /**
65      * Sets the value of carryOverCreateCount
66      *
67      * @param argCarryOverCreateCount Value to assign to this.carryOverCreateCount
68      */

69     public void setCarryOverCreateCount(long argCarryOverCreateCount) {
70         this.carryOverCreateCount = argCarryOverCreateCount;
71     }
72
73     /**
74      * Gets the value of carryOverCreateCount
75      *
76      * @return the value of carryOverCreateCount
77      * @hibernate.property
78      * column="CARRY_OVER_CREATE_COUNT"
79      */

80     public long getCarryOverCreateCount() {
81         return this.carryOverCreateCount;
82     }
83
84     /**
85      * Sets the value of carryOverUpdateCount
86      *
87      * @param argCarryOverUpdateCount Value to assign to this.carryOverUpdateCount
88      */

89     public void setCarryOverUpdateCount(long argCarryOverUpdateCount) {
90         this.carryOverUpdateCount = argCarryOverUpdateCount;
91     }
92
93     /**
94      * Gets the value of carryOverUpdateCount
95      *
96      * @return the value of carryOverUpdateCount
97      * @hibernate.property
98      * column="CARRY_OVER_UPDATE_COUNT"
99      */

100     public long getCarryOverUpdateCount() {
101         return this.carryOverUpdateCount;
102     }
103
104     /**
105      * Sets the value of completeCount
106      *
107      * @param argCompleteCount Value to assign to this.completeCount
108      */

109     public void setCompleteCount(long argCompleteCount) {
110         this.completeCount = argCompleteCount;
111     }
112
113     /**
114      * Gets the value of completeCount
115      *
116      * @return the value of completeCount
117      * @hibernate.property
118      * column="COMPLETE_COUNT"
119      */

120     public long getCompleteCount() {
121         return this.completeCount;
122     }
123
124     /**
125      * Sets the value of createCount
126      *
127      * @param argCreateCount Value to assign to this.createCount
128      */

129     public void setCreateCount(long argCreateCount) {
130         this.createCount = argCreateCount;
131     }
132
133     /**
134      * Gets the value of createCount
135      *
136      * @return the value of createCount
137      * @hibernate.property
138      * column="CREATE_COUNT"
139      */

140     public long getCreateCount() {
141         return this.createCount;
142     }
143
144     /**
145      * Sets the value of id
146      *
147      * @param argId Value to assign to this.id
148      */

149     public void setId(Long JavaDoc argId) {
150         this.id = argId;
151     }
152
153     /**
154      * Gets the value of id
155      *
156      * @return the value of id
157      * @hibernate.id
158      * generator-class="native"
159      */

160     public Long JavaDoc getId() {
161         return this.id;
162     }
163
164     /**
165      * Sets the value of updateCount
166      *
167      * @param argUpdateCount Value to assign to this.updateCount
168      */

169     public void setUpdateCount(long argUpdateCount) {
170         this.updateCount = argUpdateCount;
171     }
172
173     /**
174      * Gets the value of updateCount
175      *
176      * @return the value of updateCount
177      * @hibernate.property
178      * column="UPDATE_COUNT"
179      */

180     public long getUpdateCount() {
181         return this.updateCount;
182     }
183
184     public long calculateStats() {
185         long retVal = 0;
186
187         // Maybe add weights to this later
188
retVal =
189             carryOverCompleteCount + completeCount + carryOverCreateCount
190             + createCount + carryOverUpdateCount + updateCount;
191
192         return retVal;
193     }
194
195     public boolean equals(Object JavaDoc other) {
196         ModuleStatisticsData o = (ModuleStatisticsData) other;
197
198         return (this != null) && (o != null)
199         && (((id == null) && (o.id == null)) || id.equals(o.id))
200         && (createCount == o.createCount) && (updateCount == o.updateCount)
201         && (completeCount == o.completeCount);
202     }
203 }
204
Popular Tags