Source Code Cross Referenced for JavaSourceStatistic.java in  » Code-Analyzer » Java2Html » de » java2html » javasource » 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 » Code Analyzer » Java2Html » de.java2html.javasource 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package de.java2html.javasource;
002:
003:        /**
004:         * Simple statistics information that can be created when parsing a java source code using the
005:         * {@link de.java2html.javasource.JavaSourceParser}.
006:         * @author Markus Gebhard
007:         */
008:        public class JavaSourceStatistic {
009:            private int commentLineCount = -1;
010:            private int lineCount = -1;
011:            private int codeLineCount = -1;
012:            private int emptyLineCount = -1;
013:            private int maxLineLength = -1;
014:            private int characterCount = -1;
015:            private String packageName = null;
016:            private String fileName = null;
017:
018:            public JavaSourceStatistic() {
019:                //nothing to do
020:            }
021:
022:            /**
023:             * Returns the codeLineCount.
024:             * @return int
025:             */
026:            public int getCodeLineCount() {
027:                return codeLineCount;
028:            }
029:
030:            /**
031:             * Returns the commentLineCount.
032:             * @return int
033:             */
034:            public int getCommentLineCount() {
035:                return commentLineCount;
036:            }
037:
038:            /**
039:             * Returns the emptyLineCount.
040:             * @return int
041:             */
042:            public int getEmptyLineCount() {
043:                return emptyLineCount;
044:            }
045:
046:            /**
047:             * Returns the lineCount.
048:             * @return int
049:             */
050:            public int getLineCount() {
051:                return lineCount;
052:            }
053:
054:            /**
055:             * Returns the maxLineLength.
056:             * @return int
057:             */
058:            public int getMaxLineLength() {
059:                return maxLineLength;
060:            }
061:
062:            /**
063:             * Sets the codeLineCount.
064:             * @param codeLineCount The codeLineCount to set
065:             */
066:            public void setCodeLineCount(int codeLineCount) {
067:                this .codeLineCount = codeLineCount;
068:            }
069:
070:            /**
071:             * Sets the commentLineCount.
072:             * @param commentLineCount The commentLineCount to set
073:             */
074:            public void setCommentLineCount(int commentLineCount) {
075:                this .commentLineCount = commentLineCount;
076:            }
077:
078:            /**
079:             * Sets the emptyLineCount.
080:             * @param emptyLineCount The emptyLineCount to set
081:             */
082:            public void setEmptyLineCount(int emptyLineCount) {
083:                this .emptyLineCount = emptyLineCount;
084:            }
085:
086:            /**
087:             * Sets the lineCount.
088:             * @param lineCount The lineCount to set
089:             */
090:            public void setLineCount(int lineCount) {
091:                this .lineCount = lineCount;
092:            }
093:
094:            /**
095:             * Sets the maxLineLength.
096:             * @param maxLineLength The maxLineLength to set
097:             */
098:            public void setMaxLineLength(int maxLineLength) {
099:                this .maxLineLength = maxLineLength;
100:            }
101:
102:            /**
103:             * Returns the fileName.
104:             * @return String
105:             */
106:            public String getFileName() {
107:                return fileName;
108:            }
109:
110:            /**
111:             * Sets the fileName.
112:             * @param fileName The fileName to set
113:             */
114:            public void setFileName(String fileName) {
115:                this .fileName = fileName;
116:            }
117:
118:            public void clear() {
119:                maxLineLength = 0;
120:                lineCount = 0;
121:                commentLineCount = 0;
122:                codeLineCount = 0;
123:                emptyLineCount = 0;
124:            }
125:
126:            public String getScreenString(String lineSeparator) {
127:                StringBuffer result = new StringBuffer();
128:                result.append(" Package: " + toString(packageName)
129:                        + "  Filename: " + toString(fileName) + lineSeparator);
130:                result.append("   Lines total: " + lineCount + "  Code: "
131:                        + codeLineCount + "  Comments: " + commentLineCount
132:                        + "  Empty: " + emptyLineCount + lineSeparator);
133:                result
134:                        .append("   " + characterCount
135:                                + " Characters,  Maximum line length: "
136:                                + maxLineLength);
137:                return result.toString();
138:            }
139:
140:            private String toString(Object value) {
141:                return value == null ? "" : value.toString();
142:            }
143:
144:            public static String getExcelHeader() {
145:                StringBuffer result = new StringBuffer();
146:                result.append("package");
147:                result.append("\t");
148:                result.append("file");
149:                result.append("\t");
150:                result.append("lines total");
151:                result.append("\t");
152:                result.append("code lines");
153:                result.append("\t");
154:                result.append("comment lines");
155:                result.append("\t");
156:                result.append("empty lines");
157:                result.append("\t");
158:                result.append("characters total");
159:                result.append("\t");
160:                result.append("maximum line length");
161:                return result.toString();
162:            }
163:
164:            public String getExcelString() {
165:                StringBuffer result = new StringBuffer();
166:                result.append(packageName);
167:                result.append("\t");
168:                result.append(fileName);
169:                result.append("\t");
170:                result.append(String.valueOf(lineCount));
171:                result.append("\t");
172:                result.append(String.valueOf(codeLineCount));
173:                result.append("\t");
174:                result.append(String.valueOf(commentLineCount));
175:                result.append("\t");
176:                result.append(String.valueOf(emptyLineCount));
177:                result.append("\t");
178:                result.append(String.valueOf(characterCount));
179:                result.append("\t");
180:                result.append(String.valueOf(maxLineLength));
181:                return result.toString();
182:            }
183:
184:            /**
185:             * Returns the characterCount.
186:             * @return int
187:             */
188:            public int getCharacterCount() {
189:                return characterCount;
190:            }
191:
192:            /**
193:             * Sets the characterCount.
194:             * @param characterCount The characterCount to set
195:             */
196:            public void setCharacterCount(int characterCount) {
197:                this .characterCount = characterCount;
198:            }
199:
200:            /**
201:             * Returns the packageName.
202:             * @return String
203:             */
204:            public String getPackageName() {
205:                return packageName;
206:            }
207:
208:            /**
209:             * Sets the packageName.
210:             * @param packageName The packageName to set
211:             */
212:            public void setPackageName(String packageName) {
213:                this.packageName = packageName;
214:            }
215:
216:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.