Source Code Cross Referenced for OutlierListCollection.java in  » Chart » jfreechart » org » jfree » chart » renderer » 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 » Chart » jfreechart » org.jfree.chart.renderer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* ===========================================================
002:         * JFreeChart : a free chart library for the Java(tm) platform
003:         * ===========================================================
004:         *
005:         * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors.
006:         *
007:         * Project Info:  http://www.jfree.org/jfreechart/index.html
008:         *
009:         * This library is free software; you can redistribute it and/or modify it 
010:         * under the terms of the GNU Lesser General Public License as published by 
011:         * the Free Software Foundation; either version 2.1 of the License, or 
012:         * (at your option) any later version.
013:         *
014:         * This library is distributed in the hope that it will be useful, but 
015:         * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
016:         * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
017:         * License for more details.
018:         *
019:         * You should have received a copy of the GNU Lesser General Public
020:         * License along with this library; if not, write to the Free Software
021:         * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
022:         * USA.  
023:         *
024:         * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
025:         * in the United States and other countries.]
026:         *
027:         * --------------------------
028:         * OutlierListCollection.java
029:         * --------------------------
030:         * (C) Copyright 2003, 2004, 2007, by David Browning and Contributors.
031:         *
032:         * Original Author:  David Browning (for Australian Institute of Marine 
033:         *                   Science);
034:         * Contributor(s):   -;
035:         *
036:         * $Id: OutlierListCollection.java,v 1.2.2.2 2007/02/02 15:52:24 mungady Exp $
037:         *
038:         * Changes
039:         * -------
040:         * 05-Aug-2003 : Version 1, contributed by David Browning (DG);
041:         * 01-Sep-2003 : Made storage internal rather than extending ArrayList (DG);
042:         * ------------- JFREECHART 1.0.x ---------------------------------------------
043:         * 02-Feb-2007 : Removed author tags from all over JFreeChart sources (DG);
044:         *
045:         */
046:
047:        package org.jfree.chart.renderer;
048:
049:        import java.util.ArrayList;
050:        import java.util.Iterator;
051:        import java.util.List;
052:
053:        /**
054:         * A collection of outlier lists for a box and whisker plot. Each collection is
055:         * associated with a single box and whisker entity.
056:         *
057:         * Outliers are grouped in lists for each entity. Lists contain
058:         * one or more outliers, determined by whether overlaps have
059:         * occurred. Overlapping outliers are grouped in the same list.
060:         *
061:         * @see org.jfree.chart.renderer.OutlierList
062:         */
063:        public class OutlierListCollection {
064:
065:            /** Storage for the outlier lists. */
066:            private List outlierLists;
067:
068:            /** 
069:             * Unbelievably, outliers which are more than 2 * interquartile range are
070:             * called far outs...  See Tukey EDA  (a classic one of a kind...)
071:             */
072:            private boolean highFarOut = false;
073:
074:            /**
075:             * A flag that indicates whether or not the collection contains low far 
076:             * out values.
077:             */
078:            private boolean lowFarOut = false;
079:
080:            /**
081:             * Creates a new empty collection.
082:             */
083:            public OutlierListCollection() {
084:                this .outlierLists = new ArrayList();
085:            }
086:
087:            /**
088:             * A flag to indicate the presence of one or more far out values at the 
089:             * top end of the range.
090:             *
091:             * @return A <code>boolean</code>.
092:             */
093:            public boolean isHighFarOut() {
094:                return this .highFarOut;
095:            }
096:
097:            /**
098:             * Sets the flag that indicates the presence of one or more far out values 
099:             * at the top end of the range.
100:             *
101:             * @param farOut  the flag.
102:             */
103:            public void setHighFarOut(boolean farOut) {
104:                this .highFarOut = farOut;
105:            }
106:
107:            /**
108:             * A flag to indicate the presence of one or more far out values at the 
109:             * bottom end of the range.
110:             *
111:             * @return A <code>boolean</code>.
112:             */
113:            public boolean isLowFarOut() {
114:                return this .lowFarOut;
115:            }
116:
117:            /**
118:             * Sets the flag that indicates the presence of one or more far out values 
119:             * at the bottom end of the range.
120:             *
121:             * @param farOut  the flag.
122:             */
123:            public void setLowFarOut(boolean farOut) {
124:                this .lowFarOut = farOut;
125:            }
126:
127:            /**
128:             * Appends the specified element as a new <code>OutlierList</code> to the
129:             * end of this list if it does not overlap an outlier in an existing list.
130:             *
131:             * If it does overlap, it is appended to the outlier list which it overlaps
132:             * and that list is updated.
133:             *
134:             * @param outlier  element to be appended to this list.
135:             * 
136:             * @return <tt>true</tt> (as per the general contract of Collection.add).
137:             */
138:            public boolean add(Outlier outlier) {
139:
140:                if (this .outlierLists.isEmpty()) {
141:                    return this .outlierLists.add(new OutlierList(outlier));
142:                } else {
143:                    boolean updated = false;
144:                    for (Iterator iterator = this .outlierLists.iterator(); iterator
145:                            .hasNext();) {
146:                        OutlierList list = (OutlierList) iterator.next();
147:                        if (list.isOverlapped(outlier)) {
148:                            updated = updateOutlierList(list, outlier);
149:                        }
150:                    }
151:                    if (!updated) {
152:                        //System.err.print(" creating new outlier list ");
153:                        updated = this .outlierLists
154:                                .add(new OutlierList(outlier));
155:                    }
156:                    return updated;
157:                }
158:
159:            }
160:
161:            /**
162:             * Returns an iterator for the outlier lists.
163:             * 
164:             * @return An iterator.
165:             */
166:            public Iterator iterator() {
167:                return this .outlierLists.iterator();
168:            }
169:
170:            /** 
171:             * Updates the outlier list by adding the outlier to the end of the list and
172:             * setting the averaged outlier to the average x and y coordinnate values 
173:             * of the outliers in the list.
174:             *
175:             * @param list  the outlier list to be updated.
176:             * @param outlier  the outlier to be added
177:             *
178:             * @return <tt>true</tt> (as per the general contract of Collection.add).
179:             */
180:            private boolean updateOutlierList(OutlierList list, Outlier outlier) {
181:                boolean result = false;
182:                result = list.add(outlier);
183:                list.updateAveragedOutlier();
184:                list.setMultiple(true);
185:                return result;
186:            }
187:
188:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.