Source Code Cross Referenced for TypeMetrics.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 type
013:         *
014:         *@author     Chris Seguin
015:         *@created    July 23, 1999
016:         */
017:        public class TypeMetrics {
018:            /*<Instance Variables>*/
019:            private String packageName;
020:            private String typeName;
021:            private int publicMethodCount = 0;
022:            private int otherMethodCount = 0;
023:            private int classMethodCount = 0;
024:            private int instanceVariableCount = 0;
025:            private int classVariableCount = 0;
026:            private int statementTotal = 0;
027:            private int parameterTotal = 0;
028:            private int blockDepthTotal = 0;
029:            private int lineCountTotal = 0;
030:
031:            /*</Instance Variables>*/
032:
033:            /*<Constructor>*/
034:            /**
035:             *  Constructor for the TypeMetrics object
036:             *
037:             *@param  initPackage  The package
038:             *@param  initType     The type
039:             */
040:            public TypeMetrics(String initPackage, String initType) {
041:                packageName = initPackage;
042:                typeName = initType;
043:            }
044:
045:            /*</Constructor>*/
046:
047:            /*<Getters>*/
048:            /**
049:             *  Return the package name
050:             *
051:             *@return    the package name
052:             */
053:            public String getPackageName() {
054:                return packageName;
055:            }
056:
057:            /**
058:             *  Return the type name
059:             *
060:             *@return    The type name
061:             */
062:            public String getTypeName() {
063:                return typeName;
064:            }
065:
066:            /**
067:             *  Return the public method count
068:             *
069:             *@return    The public method count
070:             */
071:            public int getPublicMethodCount() {
072:                return publicMethodCount;
073:            }
074:
075:            /**
076:             *  Return the other method count
077:             *
078:             *@return    The other method count
079:             */
080:            public int getOtherMethodCount() {
081:                return otherMethodCount;
082:            }
083:
084:            /**
085:             *  Return the class method count
086:             *
087:             *@return    The class method count
088:             */
089:            public int getClassMethodCount() {
090:                return classMethodCount;
091:            }
092:
093:            /**
094:             *  Return the instance variable count
095:             *
096:             *@return    The instance variable count
097:             */
098:            public int getInstanceVariableCount() {
099:                return instanceVariableCount;
100:            }
101:
102:            /**
103:             *  Return the class variable count
104:             *
105:             *@return    The class variable count
106:             */
107:            public int getClassVariableCount() {
108:                return classVariableCount;
109:            }
110:
111:            /**
112:             *  Return the statement total
113:             *
114:             *@return    The statement total
115:             */
116:            public int getStatementTotal() {
117:                return statementTotal;
118:            }
119:
120:            /**
121:             *  Return the parameter total
122:             *
123:             *@return    The parameter total
124:             */
125:            public int getParameterTotal() {
126:                return parameterTotal;
127:            }
128:
129:            /**
130:             *  Return the block depth for use in computing system wide averages
131:             *
132:             *@return    The block depth total
133:             */
134:            public int getBlockDepthTotal() {
135:                return blockDepthTotal;
136:            }
137:
138:            /**
139:             *  Return the lines of code for use in computing system wide averages
140:             *
141:             *@return    The block depth total
142:             */
143:            public int getLinesOfCodeTotal() {
144:                return lineCountTotal;
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 = publicMethodCount + otherMethodCount
155:                        + classMethodCount;
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 = publicMethodCount + otherMethodCount
167:                        + classMethodCount;
168:                return top / bottom;
169:            }
170:
171:            /**
172:             *  Return the average block depth
173:             *
174:             *@return    The parameter average
175:             */
176:            public double getBlockDepthAverage() {
177:                double top = blockDepthTotal;
178:                double bottom = publicMethodCount + otherMethodCount
179:                        + classMethodCount;
180:                return top / bottom;
181:            }
182:
183:            /**
184:             *  Return the average lines of code
185:             *
186:             *@return    The parameter average
187:             */
188:            public double getLinesOfCodeAverage() {
189:                double top = lineCountTotal;
190:                double bottom = publicMethodCount + otherMethodCount
191:                        + classMethodCount;
192:                return top / bottom;
193:            }
194:
195:            /*</Getters>*/
196:
197:            /*<Setters>*/
198:            /**
199:             *  Increment the public method count
200:             */
201:            void incrPublicMethodCount() {
202:                publicMethodCount++;
203:            }
204:
205:            /**
206:             *  Increment the other method count
207:             */
208:            void incrOtherMethodCount() {
209:                otherMethodCount++;
210:            }
211:
212:            /**
213:             *  Increment the class method count
214:             */
215:            void incrClassMethodCount() {
216:                classMethodCount++;
217:            }
218:
219:            /**
220:             *  Increment the instance variable count
221:             */
222:            void incrInstanceVariableCount() {
223:                instanceVariableCount++;
224:            }
225:
226:            /**
227:             *  Increment the class variable count
228:             */
229:            void incrClassVariableCount() {
230:                classVariableCount++;
231:            }
232:
233:            /**
234:             *  Add in a method
235:             *
236:             *@param  methodData  the method data
237:             */
238:            void add(MethodMetrics methodData) {
239:                statementTotal += methodData.getStatementCount();
240:                parameterTotal += methodData.getParameterCount();
241:                blockDepthTotal += methodData.getBlockDepth();
242:                lineCountTotal += methodData.getLinesOfCode();
243:            }
244:            /*</Setters>*/
245:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.