Source Code Cross Referenced for PackageMetrics.java in  » UML » jrefactory » org » acm » seguin » metrics » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » UML » jrefactory » org.acm.seguin.metrics 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Author:  Chris Seguin
003:         *
004:         *  This software has been developed under the copyleft
005:         *  rules of the GNU General Public License.  Please
006:         *  consult the GNU General Public License for more
007:         *  details about use and distribution of this software.
008:         */
009:        package org.acm.seguin.metrics;
010:
011:        /**
012:         *  Stores the metrics for a particular package
013:         *
014:         *@author     Chris Seguin
015:         *@created    July 23, 1999
016:         */
017:        public class PackageMetrics {
018:            /*<Instance Variables>*/
019:            private String packageName;
020:            private int publicMethodTotal = 0;
021:            private int otherMethodTotal = 0;
022:            private int classMethodTotal = 0;
023:            private int instanceVariableTotal = 0;
024:            private int classVariableTotal = 0;
025:            private int classTotal = 0;
026:            private int abstractClassCount = 0;
027:            private int interfaceCount = 0;
028:            private int statementTotal = 0;
029:            private int parameterTotal = 0;
030:            private int blockDepthTotal = 0;
031:            private int lineCountTotal = 0;
032:
033:            /*</Instance Variables>*/
034:
035:            /*<Constructor>*/
036:            /**
037:             *  Constructor for the PackageMetrics object
038:             *
039:             *@param  initPackage  Description of Parameter
040:             */
041:            public PackageMetrics(String initPackage) {
042:                packageName = initPackage;
043:            }
044:
045:            /*</Constructor>*/
046:
047:            /*<Getters>*/
048:            /**
049:             *  Get the package name
050:             *
051:             *@return    the package name
052:             */
053:            public String getPackageName() {
054:                return packageName;
055:            }
056:
057:            /**
058:             *  Return the public method count
059:             *
060:             *@return    The public method count
061:             */
062:            public int getPublicMethodTotal() {
063:                return publicMethodTotal;
064:            }
065:
066:            /**
067:             *  Return the other method count
068:             *
069:             *@return    The other method count
070:             */
071:            public int getOtherMethodTotal() {
072:                return otherMethodTotal;
073:            }
074:
075:            /**
076:             *  Return the class method count
077:             *
078:             *@return    The class method count
079:             */
080:            public int getClassMethodTotal() {
081:                return classMethodTotal;
082:            }
083:
084:            /**
085:             *  Return the instance variable count
086:             *
087:             *@return    The instance variable count
088:             */
089:            public int getInstanceVariableTotal() {
090:                return instanceVariableTotal;
091:            }
092:
093:            /**
094:             *  Return the class variable count
095:             *
096:             *@return    The class variable count
097:             */
098:            public int getClassVariableTotal() {
099:                return classVariableTotal;
100:            }
101:
102:            /**
103:             *  Return the class count
104:             *
105:             *@return    The class count
106:             */
107:            public int getClassTotal() {
108:                return classTotal;
109:            }
110:
111:            /**
112:             *  Return the abstract class count
113:             *
114:             *@return    The abstract class count
115:             */
116:            public int getAbstractClassCount() {
117:                return abstractClassCount;
118:            }
119:
120:            /**
121:             *  Return the abstract class count
122:             *
123:             *@return    The abstract class count
124:             */
125:            public int getInterfaceCount() {
126:                return interfaceCount;
127:            }
128:
129:            /**
130:             *  Return the statement total
131:             *
132:             *@return    The statement total
133:             */
134:            public int getStatementTotal() {
135:                return statementTotal;
136:            }
137:
138:            /**
139:             *  Return the parameter total
140:             *
141:             *@return    The parameter total
142:             */
143:            public int getParameterTotal() {
144:                return parameterTotal;
145:            }
146:
147:            /**
148:             *  Return the statement average
149:             *
150:             *@return    The statement average
151:             */
152:            public double getStatementAverage() {
153:                double top = statementTotal;
154:                double bottom = publicMethodTotal + otherMethodTotal
155:                        + classMethodTotal;
156:                return top / bottom;
157:            }
158:
159:            /**
160:             *  Return the parameter average
161:             *
162:             *@return    The parameter average
163:             */
164:            public double getParameterAverage() {
165:                double top = parameterTotal;
166:                double bottom = publicMethodTotal + otherMethodTotal
167:                        + classMethodTotal;
168:                return top / bottom;
169:            }
170:
171:            /**
172:             *  Return the block depth average
173:             *
174:             *@return    The block depth average
175:             */
176:            public double getBlockDepthAverage() {
177:                double top = blockDepthTotal;
178:                double bottom = publicMethodTotal + otherMethodTotal
179:                        + classMethodTotal;
180:                return top / bottom;
181:            }
182:
183:            /**
184:             *  Return the lines of code average
185:             *
186:             *@return    The lines of code average
187:             */
188:            public double getLinesOfCodeAverage() {
189:                double top = lineCountTotal;
190:                double bottom = publicMethodTotal + otherMethodTotal
191:                        + classMethodTotal;
192:                return top / bottom;
193:            }
194:
195:            /**
196:             *  Return the public method count
197:             *
198:             *@return    The public method count
199:             */
200:            public double getPublicMethodAverage() {
201:                double top = publicMethodTotal;
202:                double bottom = classTotal;
203:                return top / bottom;
204:            }
205:
206:            /**
207:             *  Return the other method count
208:             *
209:             *@return    The other method count
210:             */
211:            public double getOtherMethodAverage() {
212:                double top = otherMethodTotal;
213:                double bottom = classTotal;
214:                return top / bottom;
215:            }
216:
217:            /**
218:             *  Return the class method count
219:             *
220:             *@return    The class method count
221:             */
222:            public double getClassMethodAverage() {
223:                double top = classMethodTotal;
224:                double bottom = classTotal;
225:                return top / bottom;
226:            }
227:
228:            /**
229:             *  Return the instance variable count
230:             *
231:             *@return    The instance variable count
232:             */
233:            public double getInstanceVariableAverage() {
234:                double top = instanceVariableTotal;
235:                double bottom = classTotal;
236:                return top / bottom;
237:            }
238:
239:            /**
240:             *  Return the class variable count
241:             *
242:             *@return    The class variable count
243:             */
244:            public double getClassVariableAverage() {
245:                double top = classVariableTotal;
246:                double bottom = classTotal;
247:                return top / bottom;
248:            }
249:
250:            /**
251:             *  Return the abstract class count
252:             *
253:             *@return    The abstract class count
254:             */
255:            public double getAbstractClassPercentage() {
256:                double top = abstractClassCount;
257:                double bottom = classTotal;
258:                return 100 * top / bottom;
259:            }
260:
261:            /**
262:             *  Return the abstract class count
263:             *
264:             *@return    The abstract class count
265:             */
266:            public double getInterfacePercentage() {
267:                double top = interfaceCount;
268:                double bottom = classTotal;
269:                return 100 * top / bottom;
270:            }
271:
272:            /*</Getters>*/
273:
274:            /*<Setters>*/
275:            /**
276:             *  Increment the abstract class count
277:             */
278:            void incrAbstractClassCount() {
279:                abstractClassCount++;
280:            }
281:
282:            /**
283:             *  Increment the interface count
284:             */
285:            void incrInterfaceCount() {
286:                interfaceCount++;
287:            }
288:
289:            /**
290:             *  Add in a type
291:             *
292:             *@param  typeData  the type data
293:             */
294:            void add(TypeMetrics typeData) {
295:                publicMethodTotal += typeData.getPublicMethodCount();
296:                otherMethodTotal += typeData.getOtherMethodCount();
297:                classMethodTotal += typeData.getClassMethodCount();
298:                instanceVariableTotal += typeData.getInstanceVariableCount();
299:                classVariableTotal += typeData.getClassVariableCount();
300:                statementTotal += typeData.getStatementTotal();
301:                parameterTotal += typeData.getParameterTotal();
302:                lineCountTotal += typeData.getLinesOfCodeTotal();
303:                blockDepthTotal += typeData.getBlockDepthTotal();
304:                classTotal++;
305:            }
306:            /*</Setters>*/
307:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.