Source Code Cross Referenced for Statistics.java in  » Content-Management-System » dspace » org » dspace » app » statistics » 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 » Content Management System » dspace » org.dspace.app.statistics 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Statistics.java
003:         *
004:         * Version: $Revision: 1189 $
005:         *
006:         * Date: $Date: 2005-04-20 09:23:44 -0500 (Wed, 20 Apr 2005) $
007:         *
008:         * Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
009:         * Institute of Technology.  All rights reserved.
010:         *
011:         * Redistribution and use in source and binary forms, with or without
012:         * modification, are permitted provided that the following conditions are
013:         * met:
014:         *
015:         * - Redistributions of source code must retain the above copyright
016:         * notice, this list of conditions and the following disclaimer.
017:         *
018:         * - Redistributions in binary form must reproduce the above copyright
019:         * notice, this list of conditions and the following disclaimer in the
020:         * documentation and/or other materials provided with the distribution.
021:         *
022:         * - Neither the name of the Hewlett-Packard Company nor the name of the
023:         * Massachusetts Institute of Technology nor the names of their
024:         * contributors may be used to endorse or promote products derived from
025:         * this software without specific prior written permission.
026:         *
027:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
028:         * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
029:         * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
030:         * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
031:         * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
032:         * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
033:         * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
034:         * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
035:         * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
036:         * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
037:         * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
038:         * DAMAGE.
039:         */
040:
041:        package org.dspace.app.statistics;
042:
043:        import org.dspace.app.statistics.Stat;
044:
045:        import java.util.ArrayList;
046:        import java.util.List;
047:
048:        /**
049:         * This class provides a wrapper for a related set of statistics.  It contains
050:         * headers for the Stat key and value pairs for the convenience of displaying
051:         * them to users as, for example, HTML table headers.  It also holds the 
052:         * list of statistics, and can have them added to itself individually or in
053:         * arrays
054:         *
055:         * @author  Richard Jones
056:         */
057:        public class Statistics {
058:            // FIXME: this class could probably do with some tidying
059:
060:            /** the header for the statistics type.  Useful for outputting to user */
061:            private String statName = null;
062:
063:            /** the header for the results.  Useful for outputting to user */
064:            private String resultName = null;
065:
066:            /** a list to hold all of the stat elements that this object contains */
067:            private List stats = new ArrayList();
068:
069:            /** the floor value for this set of statistics */
070:            private int floor = 0;
071:
072:            /** an explanation of this statistics set */
073:            private String explanation = null;
074:
075:            /** the main section header for this set of statistics */
076:            private String sectionHeader = null;
077:
078:            /**
079:             * constructor to create new set of statistics
080:             */
081:            Statistics() {
082:                // empty constructor
083:            }
084:
085:            /**
086:             * constructor to create new statistic with relevant headers
087:             *
088:             * @param   statName     name of the statistic
089:             * @param   resultName   name of the result
090:             */
091:            Statistics(String statName, String resultName) {
092:                this .statName = statName;
093:                this .resultName = resultName;
094:            }
095:
096:            /**
097:             * constructor to create new statistic with relevant headers
098:             *
099:             * @param   statName     name of the statistic
100:             * @param   resultName   name of the result
101:             */
102:            Statistics(String statName, String resultName, int floor) {
103:                this .statName = statName;
104:                this .resultName = resultName;
105:                this .floor = floor;
106:            }
107:
108:            /**
109:             * add an individual statistic to this object
110:             *
111:             * @param   stat    a statistic for this object
112:             */
113:            public void add(Stat stat) {
114:                this .stats.add(stat);
115:                return;
116:            }
117:
118:            /**
119:             * set the name of the statistic column
120:             *
121:             * @param   name    the name of the statistic column
122:             */
123:            public void setStatName(String name) {
124:                this .statName = name;
125:            }
126:
127:            /**
128:             * set the name of the results column
129:             *
130:             * @param   name    the name of the results column
131:             */
132:            public void setResultName(String name) {
133:                this .resultName = name;
134:            }
135:
136:            /**
137:             * set the explanatory or clarification information for this block of stats
138:             *
139:             * @param   explanation     the explanation for this stat block
140:             */
141:            public void setExplanation(String explanation) {
142:                this .explanation = explanation;
143:            }
144:
145:            /**
146:             * get the explanation or clarification information for this block of stats
147:             *
148:             * @return      the explanation for this stat block
149:             */
150:            public String getExplanation() {
151:                return this .explanation;
152:            }
153:
154:            /**
155:             * set the floor value used in this stat block
156:             *
157:             * @param   floor   the floor value for this stat block
158:             */
159:            public void setFloor(int floor) {
160:                this .floor = floor;
161:            }
162:
163:            /**
164:             * get the floor value used in this stat block
165:             *
166:             * @return  the floor value for this stat block
167:             */
168:            public int getFloor() {
169:                return this .floor;
170:            }
171:
172:            /**
173:             * set the header for this particular stats block
174:             *
175:             * @param   header for this stats block
176:             */
177:            public void setSectionHeader(String header) {
178:                this .sectionHeader = header;
179:            }
180:
181:            /**
182:             * get the header for this particular stats block
183:             *
184:             * @return  the header for this stats block
185:             */
186:            public String getSectionHeader() {
187:                return this .sectionHeader;
188:            }
189:
190:            /**
191:             * add an array of statistics to this object
192:             *
193:             * @param   stats   an array of statistics
194:             */
195:            public void add(Stat[] stats) {
196:                for (int i = 0; i < stats.length; i++) {
197:                    this .stats.add(stats[i]);
198:                }
199:                return;
200:            }
201:
202:            /**
203:             * get an array of statistics back from this object
204:             *
205:             * @return      the statistics array
206:             */
207:            public Stat[] getStats() {
208:                Stat[] myStats = new Stat[stats.size()];
209:                myStats = (Stat[]) stats.toArray(myStats);
210:                return myStats;
211:            }
212:
213:            /**
214:             * get the name of the statistic
215:             *
216:             * @return      the name of the statistic
217:             */
218:            public String getStatName() {
219:                return statName;
220:            }
221:
222:            /**
223:             * get the name of the result set
224:             *
225:             * @return      the name of the result set
226:             */
227:            public String getResultName() {
228:                return resultName;
229:            }
230:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.