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


001:        package org.geotools.data.store;
002:
003:        import java.io.IOException;
004:        import java.util.ArrayList;
005:        import java.util.Collection;
006:        import java.util.Iterator;
007:        import java.util.List;
008:
009:        import org.geotools.data.FeatureReader;
010:        import org.geotools.data.collection.DelegateFeatureReader;
011:        import org.geotools.feature.CollectionListener;
012:        import org.geotools.feature.FeatureCollection;
013:        import org.geotools.feature.FeatureIterator;
014:        import org.geotools.feature.FeatureList;
015:        import org.geotools.feature.FeatureType;
016:        import org.geotools.feature.IllegalAttributeException;
017:        import org.geotools.feature.collection.DelegateFeatureIterator;
018:        import org.geotools.feature.visitor.FeatureVisitor;
019:        import org.geotools.geometry.jts.ReferencedEnvelope;
020:        import org.geotools.util.ProgressListener;
021:        import org.opengis.filter.Filter;
022:        import org.opengis.filter.sort.SortBy;
023:
024:        import com.vividsolutions.jts.geom.Envelope;
025:        import com.vividsolutions.jts.geom.Geometry;
026:
027:        /**
028:         * FeatureCollection decorator which decorates a feature collection "re-typing" 
029:         * its schema based on attributes specified in a query.
030:         * 
031:         * @author Justin Deoliveira, The Open Planning Project
032:         *
033:         */
034:        public class ReTypingFeatureCollection implements  FeatureCollection {
035:
036:            FeatureCollection delegate;
037:            FeatureType featureType;
038:
039:            public ReTypingFeatureCollection(FeatureCollection delegate,
040:                    FeatureType featureType) {
041:                this .delegate = delegate;
042:                this .featureType = featureType;
043:            }
044:
045:            public FeatureReader reader() throws IOException {
046:                return new DelegateFeatureReader(getSchema(), features());
047:            }
048:
049:            public FeatureIterator features() {
050:                return new DelegateFeatureIterator(this , iterator());
051:            }
052:
053:            public void close(FeatureIterator close) {
054:                close.close();
055:            }
056:
057:            public Iterator iterator() {
058:                return new ReTypingIterator(delegate.iterator(), delegate
059:                        .getSchema(), featureType);
060:            }
061:
062:            public void close(Iterator close) {
063:                ReTypingIterator reType = (ReTypingIterator) close;
064:                delegate.close(reType.getDelegate());
065:            }
066:
067:            public void addListener(CollectionListener listener)
068:                    throws NullPointerException {
069:                delegate.addListener(listener);
070:            }
071:
072:            public void removeListener(CollectionListener listener)
073:                    throws NullPointerException {
074:                delegate.removeListener(listener);
075:            }
076:
077:            public FeatureType getFeatureType() {
078:                return delegate.getFeatureType();
079:            }
080:
081:            public FeatureType getSchema() {
082:                return featureType;
083:            }
084:
085:            public void accepts(FeatureVisitor visitor,
086:                    ProgressListener progress) throws IOException {
087:                delegate.accepts(visitor, progress);
088:            }
089:
090:            public FeatureCollection subCollection(Filter filter) {
091:                throw new UnsupportedOperationException();
092:            }
093:
094:            public FeatureList sort(SortBy order) {
095:                throw new UnsupportedOperationException();
096:            }
097:
098:            public void purge() {
099:                delegate.purge();
100:            }
101:
102:            public int size() {
103:                return delegate.size();
104:            }
105:
106:            public void clear() {
107:                delegate.clear();
108:            }
109:
110:            public boolean isEmpty() {
111:                return delegate.isEmpty();
112:            }
113:
114:            public Object[] toArray() {
115:                return toArray(new Object[size()]);
116:            }
117:
118:            public Object[] toArray(Object[] a) {
119:                List list = new ArrayList();
120:                Iterator i = iterator();
121:                try {
122:                    while (i.hasNext()) {
123:                        list.add(i.next());
124:                    }
125:
126:                    return list.toArray(a);
127:                } finally {
128:                    close(i);
129:                }
130:            }
131:
132:            public boolean add(Object o) {
133:                return delegate.add(o);
134:            }
135:
136:            public boolean contains(Object o) {
137:                return delegate.add(o);
138:            }
139:
140:            public boolean remove(Object o) {
141:                return delegate.remove(o);
142:            }
143:
144:            public boolean addAll(Collection c) {
145:                return delegate.addAll(c);
146:            }
147:
148:            public boolean containsAll(Collection c) {
149:                return delegate.containsAll(c);
150:            }
151:
152:            public boolean removeAll(Collection c) {
153:                return delegate.removeAll(c);
154:            }
155:
156:            public boolean retainAll(Collection c) {
157:                return delegate.retainAll(c);
158:            }
159:
160:            public String getID() {
161:                return delegate.getID();
162:            }
163:
164:            public Object[] getAttributes(Object[] attributes) {
165:                return delegate.getAttributes(attributes);
166:            }
167:
168:            public Object getAttribute(String xPath) {
169:                return delegate.getAttribute(xPath);
170:            }
171:
172:            public Object getAttribute(int index) {
173:                return delegate.getAttribute(index);
174:            }
175:
176:            public void setAttribute(int position, Object val)
177:                    throws IllegalAttributeException,
178:                    ArrayIndexOutOfBoundsException {
179:                delegate.setAttribute(position, val);
180:            }
181:
182:            public int getNumberOfAttributes() {
183:                return delegate.getNumberOfAttributes();
184:            }
185:
186:            public void setAttribute(String xPath, Object attribute)
187:                    throws IllegalAttributeException {
188:                delegate.setAttribute(xPath, attribute);
189:            }
190:
191:            public Geometry getDefaultGeometry() {
192:                return delegate.getDefaultGeometry();
193:            }
194:
195:            public void setDefaultGeometry(Geometry geometry)
196:                    throws IllegalAttributeException {
197:                delegate.setDefaultGeometry(geometry);
198:            }
199:
200:            public ReferencedEnvelope getBounds() {
201:                return delegate.getBounds();
202:            }
203:
204:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.