Source Code Cross Referenced for GM_Aggregate.java in  » GIS » GeOxygene-1.3 » fr » ign » cogit » geoxygene » spatial » geomaggr » 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 » GIS » GeOxygene 1.3 » fr.ign.cogit.geoxygene.spatial.geomaggr 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of the GeOxygene project source files. 
003:         * 
004:         * GeOxygene aims at providing an open framework which implements OGC/ISO specifications for 
005:         * the development and deployment of geographic (GIS) applications. It is a open source 
006:         * contribution of the COGIT laboratory at the Institut Géographique National (the French 
007:         * National Mapping Agency).
008:         * 
009:         * See: http://oxygene-project.sourceforge.net 
010:         *  
011:         * Copyright (C) 2005 Institut Géographique National
012:         *
013:         * This library is free software; you can redistribute it and/or modify it under the terms
014:         * of the GNU Lesser General Public License as published by the Free Software Foundation; 
015:         * either version 2.1 of the License, or any later version.
016:         *
017:         * This library is distributed in the hope that it will be useful, but WITHOUT ANY 
018:         * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
019:         * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
020:         *
021:         * You should have received a copy of the GNU Lesser General Public License along with 
022:         * this library (see file LICENSE if present); if not, write to the Free Software 
023:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:         *  
025:         */
026:
027:        package fr.ign.cogit.geoxygene.spatial.geomaggr;
028:
029:        import java.util.ArrayList;
030:        import java.util.Iterator;
031:        import java.util.List;
032:
033:        import fr.ign.cogit.geoxygene.spatial.coordgeom.DirectPositionList;
034:        import fr.ign.cogit.geoxygene.spatial.geomroot.GM_Object;
035:
036:        /**
037:         * Agrégation quelconque d'objets géométriques. Il n'y a aucune structure interne.
038:         * On aurait pu faire un set d'elements au lieu d'une liste ? 
039:         *
040:         * @author Thierry Badard & Arnaud Braun
041:         * @version 1.0
042:         * 
043:         */
044:
045:        public class GM_Aggregate extends GM_Object {
046:
047:            /** Liste des éléments constituant self. */
048:            protected List element;
049:
050:            /** Itérateur sur laliste des éléments. */
051:            protected Iterator iElement;
052:
053:            /** Renvoie l'attribut element = liste de GM_Object. */
054:            public List getList() {
055:                return this .element;
056:            }
057:
058:            /** Affecte une liste de GM_Object. */
059:            public void setList(List L) {
060:                element = L;
061:            }
062:
063:            /** Renvoie l'élément de rang i */
064:            public GM_Object get(int i) {
065:                return (GM_Object) this .element.get(i);
066:            }
067:
068:            /** Affecte un élément au i-ème rang de la liste */
069:            public void set(int i, GM_Object value) {
070:                this .element.set(i, value);
071:            }
072:
073:            /** Ajoute un élément en fin de liste */
074:            public void add(GM_Object value) {
075:                this .element.add(value);
076:            }
077:
078:            /** Ajoute une liste d'éléments en fin de liste */
079:            public void addAll(List theList) {
080:                this .element.addAll(theList);
081:            }
082:
083:            /** Ajoute un élément au i-ème rang de la liste */
084:            public void add(int i, GM_Object value) {
085:                this .element.add(i, value);
086:            }
087:
088:            /** Efface de la liste le (ou les) éléments passé en paramètre */
089:            public void remove(GM_Object value) {
090:                this .element.remove(value);
091:            }
092:
093:            /** Efface le i-ème élément de la liste */
094:            public void remove(int i) {
095:                this .element.remove(i);
096:            }
097:
098:            /** Efface toute la liste */
099:            public void clear() {
100:                this .element.clear();
101:            }
102:
103:            /** Initialise l'itérateur de la liste. */
104:            public void initIterator() {
105:                iElement = this .element.iterator();
106:            }
107:
108:            /** Renvoie true s'il reste des éléments avec l'itérateur, false sinon. */
109:            public boolean hasNext() {
110:                if (iElement.hasNext())
111:                    return true;
112:                else
113:                    return false;
114:            }
115:
116:            /** Renvoie le prochain élément avec l'iterateur. */
117:            public GM_Object next() {
118:                return (GM_Object) iElement.next();
119:            }
120:
121:            /** Renvoie le nombre de éléments */
122:            public int size() {
123:                return this .element.size();
124:            }
125:
126:            /** Convertit l'agrégat en un tableau de GM_Obect. */
127:            public GM_Object[] toArray() {
128:                GM_Object[] result = new GM_Object[size()];
129:                initIterator();
130:                int i = 0;
131:                while (hasNext()) {
132:                    result[i] = next();
133:                    i++;
134:                }
135:                return result;
136:            }
137:
138:            /** NON IMPLEMENTE (renvoie null).
139:             * Collection de GM_Object représentant la frontière de self.
140:             * Cette collection d'objets a une structure de GM_Boundary, qui est un sous-type de GM_Complex. 
141:             */
142:            /*public GM_Boundary boundary() {
143:                return null;
144:            }   */
145:
146:            /** Constructeur par défaut. */
147:            public GM_Aggregate() {
148:                element = new ArrayList();
149:            }
150:
151:            /** Constructeur à partir d'un GM_Object. */
152:            public GM_Aggregate(GM_Object anObject) {
153:                element = new ArrayList();
154:                this .add(anObject);
155:            }
156:
157:            /**Constructeur à partir d'une liste de GM_Object. */
158:            public GM_Aggregate(List fromSet) {
159:                element = new ArrayList();
160:                int n = fromSet.size();
161:                if (n > 0)
162:                    for (int i = 0; i < n; i++)
163:                        this .add((GM_Object) fromSet.get(i));
164:            }
165:
166:            /** Renvoie une DirectPositionList de tous les points de l'objet. */
167:            public DirectPositionList coord() {
168:                DirectPositionList result = new DirectPositionList();
169:                initIterator();
170:                while (hasNext())
171:                    result.addAll(next().coord());
172:                return result;
173:            }
174:
175:            /** Pour l'affichage des coordonnees. */
176:            /*public String toString() {
177:                String result = new String();
178:                initIterator();
179:                int i=0;
180:                while (hasNext()) {
181:                    result = result+"\nGM_Aggregate - element "+i+"\n";
182:                    result = result+next().toString();
183:                }
184:                return result;
185:            }*/
186:
187:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.