Source Code Cross Referenced for AbstractFeatureCollection.java in  » GIS » GeoTools-2.4.1 » org » geotools » feature » iso » collection » 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 » GeoTools 2.4.1 » org.geotools.feature.iso.collection 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.geotools.feature.iso.collection;
002:
003:        import java.util.Collection;
004:        import java.util.Iterator;
005:        import java.util.List;
006:
007:        import org.geotools.util.NullProgressListener;
008:        import org.opengis.feature.Feature;
009:        import org.opengis.feature.FeatureCollection;
010:        import org.opengis.feature.FeatureVisitor;
011:        import org.opengis.feature.GeometryAttribute;
012:        import org.opengis.feature.type.AttributeDescriptor;
013:        import org.opengis.feature.type.AttributeType;
014:        import org.opengis.feature.type.FeatureCollectionType;
015:        import org.opengis.feature.type.Name;
016:        import org.opengis.feature.type.PropertyDescriptor;
017:        import org.opengis.geometry.BoundingBox;
018:        import org.opengis.referencing.crs.CoordinateReferenceSystem;
019:        import org.opengis.util.ProgressListener;
020:
021:        /**
022:         * Abstract feature collection to be used as base for FeatureCollection
023:         * implementations. <br>
024:         * <p>
025:         * Subclasses must implement the following methods:
026:         * <ul>
027:         * <li>{@link Collection#size()}
028:         * <li>{@link org.geotools.feature.collection.AbstractResourceCollection#openIterator()}
029:         * <li>{@link org.geotools.feature.collection.AbstractResourceCollection#closeIterator(Iterator)}
030:         * </ul>
031:         * </p>
032:         * <br>
033:         * <p>
034:         * This implementation of FeatureCollection uses a delegate to satisfy the
035:         * methods of the {@link Feature} interface.
036:         * </p>
037:         * 
038:         * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
039:         * 
040:         */
041:        public abstract class AbstractFeatureCollection extends
042:                AbstractResourceCollection implements  FeatureCollection {
043:
044:            private FeatureState delegate;
045:
046:            protected AbstractFeatureCollection(Collection values,
047:                    AttributeDescriptor descriptor, String id) {
048:                this .delegate = new FeatureState(values, descriptor, id, this );
049:            }
050:
051:            protected AbstractFeatureCollection(Collection values,
052:                    FeatureCollectionType type, String id) {
053:                this .delegate = new FeatureState(values, type, id, this );
054:            }
055:
056:            public FeatureCollection subCollection(
057:                    org.opengis.filter.Filter filter) {
058:                // TODO: inject a filter factory
059:                return new SubFeatureCollection(this , filter, null);
060:            }
061:
062:            public FeatureCollection sort(org.opengis.filter.sort.SortBy order) {
063:                throw new UnsupportedOperationException();
064:            }
065:
066:            public Collection memberTypes() {
067:                return ((FeatureCollectionType) getType()).getMembers();
068:            }
069:
070:            public void putUserData(Object key, Object value) {
071:                delegate.putUserData(key, value);
072:            }
073:
074:            public Object getUserData(Object key) {
075:                return delegate.getUserData(key);
076:            }
077:
078:            public AttributeType getType() {
079:                return delegate.getType();
080:            }
081:
082:            public boolean nillable() {
083:                return delegate.nillable();
084:            }
085:
086:            public String getID() {
087:                return delegate.getID();
088:            }
089:
090:            public CoordinateReferenceSystem getCRS() {
091:                return delegate.getCRS();
092:            }
093:
094:            public void setCRS(CoordinateReferenceSystem crs) {
095:                delegate.setCRS(crs);
096:            }
097:
098:            public BoundingBox getBounds() {
099:                return delegate.getBounds();
100:            }
101:
102:            public GeometryAttribute getDefaultGeometry() {
103:                return delegate.getDefaultGeometry();
104:            }
105:
106:            public void setDefaultGeometry(GeometryAttribute geom) {
107:                delegate.setDefaultGeometry(geom);
108:            }
109:
110:            public void setValue(List newValue) throws IllegalArgumentException {
111:                delegate.setValue(newValue);
112:            }
113:
114:            public List get(Name name) {
115:                return delegate.get(name);
116:            }
117:
118:            public AttributeDescriptor getDescriptor() {
119:                return delegate.getDescriptor();
120:            }
121:
122:            public PropertyDescriptor descriptor() {
123:                return delegate.descriptor();
124:            }
125:
126:            public Name name() {
127:                return delegate.name();
128:            }
129:
130:            public Object getValue() {
131:                return delegate.getValue();
132:            }
133:
134:            public Collection attributes() {
135:                return delegate.attributes();
136:            }
137:
138:            public Collection associations() {
139:                return delegate.associations();
140:            }
141:
142:            public void setValue(Object newValue)
143:                    throws IllegalArgumentException {
144:                delegate.setValue(newValue);
145:            }
146:
147:            /**
148:             * Accepts a visitor, which then visits each feature in the collection.
149:             */
150:            public void accepts(FeatureVisitor visitor,
151:                    ProgressListener progress) {
152:                Iterator iterator = null;
153:                if (progress == null)
154:                    progress = new NullProgressListener();
155:                try {
156:                    float size = size();
157:                    float position = 0;
158:                    progress.started();
159:                    for (iterator = iterator(); !progress.isCanceled()
160:                            && iterator.hasNext(); progress.progress(position++
161:                            / size)) {
162:                        try {
163:                            Feature feature = (Feature) iterator.next();
164:                            visitor.visit(feature);
165:                        } catch (Exception erp) {
166:                            progress.exceptionOccurred(erp);
167:                        }
168:                    }
169:                } finally {
170:                    progress.complete();
171:                    close(iterator);
172:                }
173:            }
174:
175:            public Object operation(Name arg0, List arg1) {
176:                throw new UnsupportedOperationException(
177:                        "operation not supported yet");
178:            }
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.