Source Code Cross Referenced for StatisticalSummaryValues.java in  » Science » Apache-commons-math-1.1 » org » apache » commons » math » stat » descriptive » 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 » Science » Apache commons math 1.1 » org.apache.commons.math.stat.descriptive 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.apache.commons.math.stat.descriptive;
017:
018:        import java.io.Serializable;
019:        import org.apache.commons.math.util.MathUtils;
020:
021:        /**
022:         *  Value object representing the results of a univariate statistical summary.
023:         *
024:         * @version $Revision: 348519 $ $Date: 2005-11-23 12:12:18 -0700 (Wed, 23 Nov 2005) $
025:         */
026:        public class StatisticalSummaryValues implements  Serializable,
027:                StatisticalSummary {
028:
029:            /** Serialization id */
030:            private static final long serialVersionUID = -5108854841843722536L;
031:
032:            /** The sample mean */
033:            private final double mean;
034:
035:            /** The sample variance */
036:            private final double variance;
037:
038:            /** The number of observations in the sample */
039:            private final long n;
040:
041:            /** The maximum value */
042:            private final double max;
043:
044:            /** The minimum value */
045:            private final double min;
046:
047:            /** The sum of the sample values */
048:            private final double sum;
049:
050:            /**
051:             * Constructor
052:             * 
053:             * @param mean  the sample mean
054:             * @param variance  the sample variance
055:             * @param n  the number of observations in the sample 
056:             * @param max  the maximum value
057:             * @param min  the minimum value
058:             * @param sum  the sum of the values
059:             */
060:            public StatisticalSummaryValues(double mean, double variance,
061:                    long n, double max, double min, double sum) {
062:                super ();
063:                this .mean = mean;
064:                this .variance = variance;
065:                this .n = n;
066:                this .max = max;
067:                this .min = min;
068:                this .sum = sum;
069:            }
070:
071:            /**
072:             * @return Returns the max.
073:             */
074:            public double getMax() {
075:                return max;
076:            }
077:
078:            /**
079:             * @return Returns the mean.
080:             */
081:            public double getMean() {
082:                return mean;
083:            }
084:
085:            /**
086:             * @return Returns the min.
087:             */
088:            public double getMin() {
089:                return min;
090:            }
091:
092:            /**
093:             * @return Returns the number of values.
094:             */
095:            public long getN() {
096:                return n;
097:            }
098:
099:            /**
100:             * @return Returns the sum.
101:             */
102:            public double getSum() {
103:                return sum;
104:            }
105:
106:            /**
107:             * @return Returns the standard deviation
108:             */
109:            public double getStandardDeviation() {
110:                return Math.sqrt(variance);
111:            }
112:
113:            /**
114:             * @return Returns the variance.
115:             */
116:            public double getVariance() {
117:                return variance;
118:            }
119:
120:            /**
121:             * Returns true iff <code>object</code> is a 
122:             * <code>StatisticalSummaryValues</code> instance and all statistics have
123:             *  the same values as this.
124:             * 
125:             * @param object the object to test equality against.
126:             * @return true if object equals this
127:             */
128:            public boolean equals(Object object) {
129:                if (object == this ) {
130:                    return true;
131:                }
132:                if (object instanceof  StatisticalSummaryValues == false) {
133:                    return false;
134:                }
135:                StatisticalSummaryValues stat = (StatisticalSummaryValues) object;
136:                return (MathUtils.equals(stat.getMax(), this .getMax())
137:                        && MathUtils.equals(stat.getMean(), this .getMean())
138:                        && MathUtils.equals(stat.getMin(), this .getMin())
139:                        && MathUtils.equals(stat.getN(), this .getN())
140:                        && MathUtils.equals(stat.getSum(), this .getSum()) && MathUtils
141:                        .equals(stat.getVariance(), this .getVariance()));
142:            }
143:
144:            /**
145:             * Returns hash code based on values of statistics
146:             * 
147:             * @return hash code
148:             */
149:            public int hashCode() {
150:                int result = 31 + MathUtils.hash(getMax());
151:                result = result * 31 + MathUtils.hash(getMean());
152:                result = result * 31 + MathUtils.hash(getMin());
153:                result = result * 31 + MathUtils.hash(getN());
154:                result = result * 31 + MathUtils.hash(getSum());
155:                result = result * 31 + MathUtils.hash(getVariance());
156:                return result;
157:            }
158:
159:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.