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


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2004-2006, Geotools Project Managment Committee (PMC)
005:         *
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation; either
009:         *    version 2.1 of the License, or (at your option) any later version.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         *
016:         *    Created on Aug 5, 2004
017:         */
018:        package org.geotools.data.vpf;
019:
020:        import java.net.URI;
021:        import java.util.List;
022:
023:        import org.geotools.feature.AttributeType;
024:        import org.geotools.feature.Feature;
025:        import org.geotools.feature.FeatureType;
026:        import org.geotools.feature.GeometryAttributeType;
027:        import org.geotools.feature.IllegalAttributeException;
028:
029:        /**
030:         * A VPF feature type. Note that feature classes may contain one
031:         * or more feature types. However, all of the feature types of a 
032:         * feature class share the same schema. A feature type will therefore
033:         * delegate its schema related operations to its feature class.
034:         *
035:         * @author <a href="mailto:jeff@ionicenterprise.com">Jeff Yutzler</a>
036:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/vpf/src/main/java/org/geotools/data/vpf/VPFFeatureType.java $
037:         */
038:        public class VPFFeatureType implements  FeatureType {
039:            /**
040:             * The feature class that this feature type belongs to
041:             */
042:            private final VPFFeatureClass featureClass;
043:            /**
044:             * The type name for this specific feature type
045:             */
046:            private final String typeName;
047:            /**
048:             * The FACC code, a two-letter, 3-number code
049:             * identifying the feature type
050:             */
051:            private final String faccCode;
052:
053:            /**
054:             * Constructor
055:             * @param cFeatureClass The owning feature class
056:             * @param cFeature A <code>Feature</code> from the char.vdt file 
057:             * with more detailed information for this feature type
058:             */
059:            public VPFFeatureType(VPFFeatureClass cFeatureClass,
060:                    Feature cFeature) {
061:                featureClass = cFeatureClass;
062:                faccCode = cFeature.getAttribute("value").toString().trim();
063:                String mainTableFileName = cFeature.getAttribute("table")
064:                        .toString().trim();
065:
066:                String tempTypeName = cFeature.getAttribute("description")
067:                        .toString().trim();
068:
069:                // This block helps us give tables a distinguishing suffix
070:                try {
071:                    int index = mainTableFileName.lastIndexOf(".") + 1;
072:                    String dimensionality = mainTableFileName.substring(index,
073:                            index + 1).toLowerCase();
074:                    if (dimensionality.equals("a")) {
075:                        tempTypeName = tempTypeName.concat(" Area");
076:                    } else if (dimensionality.equals("l")) {
077:                        tempTypeName = tempTypeName.concat(" Line");
078:                    } else if (dimensionality.equals("p")) {
079:                        tempTypeName = tempTypeName.concat(" Point");
080:                    } else if (dimensionality.equals("t")) {
081:                        tempTypeName = tempTypeName.concat(" Text");
082:                    }
083:                } catch (RuntimeException e) {
084:                    // If this does not work, no big deal
085:                }
086:                tempTypeName = tempTypeName.toUpperCase();
087:                tempTypeName = tempTypeName.replace(' ', '_');
088:                tempTypeName = tempTypeName.replace('/', '_');
089:                tempTypeName = tempTypeName.replace('(', '_');
090:                tempTypeName = tempTypeName.replace(')', '_');
091:                typeName = tempTypeName;
092:            }
093:
094:            /**
095:             * A constructor for feature types with no information
096:             * in a char.vdt file.
097:             * @param cFeatureClass The owning feature class
098:             */
099:            public VPFFeatureType(VPFFeatureClass cFeatureClass) {
100:                featureClass = cFeatureClass;
101:                faccCode = null;
102:                typeName = cFeatureClass.getTypeName().toUpperCase();
103:
104:            }
105:
106:            /* (non-Javadoc)
107:             * @see org.geotools.feature.FeatureFactory#create(java.lang.Object[])
108:             */
109:            public Feature create(Object[] attributes)
110:                    throws IllegalAttributeException {
111:                return featureClass.create(attributes);
112:            }
113:
114:            /* (non-Javadoc)
115:             * @see org.geotools.feature.FeatureFactory#create(java.lang.Object[], java.lang.String)
116:             */
117:            public Feature create(Object[] attributes, String featureID)
118:                    throws IllegalAttributeException {
119:                return featureClass.create(attributes, featureID);
120:            }
121:
122:            /* (non-Javadoc)
123:             * @see org.geotools.feature.FeatureType#duplicate(org.geotools.feature.Feature)
124:             */
125:            public Feature duplicate(Feature feature)
126:                    throws IllegalAttributeException {
127:                return featureClass.duplicate(feature);
128:            }
129:
130:            /* (non-Javadoc)
131:             * @see org.geotools.feature.FeatureType#find(org.geotools.feature.AttributeType)
132:             */
133:            public int find(AttributeType type) {
134:                return featureClass.find(type);
135:            }
136:
137:            /* (non-Javadoc)
138:             * @see org.geotools.feature.FeatureType#getAncestors()
139:             */
140:            public FeatureType[] getAncestors() {
141:                return featureClass.getAncestors();
142:            }
143:
144:            /* (non-Javadoc)
145:             * @see org.geotools.feature.FeatureType#getAttributeCount()
146:             */
147:            public int getAttributeCount() {
148:                return featureClass.getAttributeCount();
149:            }
150:
151:            /* (non-Javadoc)
152:             * @see org.geotools.feature.FeatureType#getAttributeType(int)
153:             */
154:            public AttributeType getAttributeType(int position) {
155:                return featureClass.getAttributeType(position);
156:            }
157:
158:            /* (non-Javadoc)
159:             * @see org.geotools.feature.FeatureType#getAttributeType(java.lang.String)
160:             */
161:            public AttributeType getAttributeType(String xPath) {
162:                return featureClass.getAttributeType(xPath);
163:            }
164:
165:            /* (non-Javadoc)
166:             * @see org.geotools.feature.FeatureType#getAttributeTypes()
167:             */
168:            public AttributeType[] getAttributeTypes() {
169:                return featureClass.getAttributeTypes();
170:            }
171:
172:            /**
173:             * @return The <code>VPFCoverage</code> that this <code>FeatureType</code> 
174:             *         belongs to.
175:             */
176:            public VPFCoverage getCoverage() {
177:                return featureClass.getCoverage();
178:            }
179:
180:            /* (non-Javadoc)
181:             * @see org.geotools.feature.FeatureType#getDefaultGeometry()
182:             */
183:            public GeometryAttributeType getDefaultGeometry() {
184:                return featureClass.getDefaultGeometry();
185:            }
186:
187:            /* (non-Javadoc)
188:             * @see org.geotools.feature.FeatureType#getPrimaryGeometry()
189:             */
190:            public GeometryAttributeType getPrimaryGeometry() {
191:                return featureClass.getPrimaryGeometry();
192:            }
193:
194:            /**
195:             * @return The <code>String</code> path for the directory containing the
196:             *         <code>VPFFeatureClass</code> that this <code>FeatureType</code> 
197:             *         belongs to.
198:             */
199:            public String getDirectoryName() {
200:                return featureClass.getDirectoryName();
201:            }
202:
203:            /**
204:             * @return Returns the featureClass.
205:             */
206:            public VPFFeatureClass getFeatureClass() {
207:                return featureClass;
208:            }
209:
210:            /**
211:             * Returns a list of file objects
212:             *
213:             * @return A <code>List</code> containing <code>VPFFile</code> objects.
214:             */
215:            public List getFileList() {
216:                return featureClass.getFileList();
217:            }
218:
219:            /**
220:             * @return A <code>List</code> containing the <code>ColumnPair</code>
221:             *         objects which identify the file joins for the 
222:             *         <code>VPFFeatureClass</code> that this <code>FeatureType</code> 
223:             *         belongs to.
224:             */
225:            public List getJoinList() {
226:                return featureClass.getJoinList();
227:            }
228:
229:            /* (non-Javadoc)
230:             * @see org.geotools.feature.FeatureType#getNamespace()
231:             */
232:            public URI getNamespace() {
233:                return featureClass.getNamespace();
234:            }
235:
236:            //    /* (non-Javadoc)
237:            //     * @see org.geotools.feature.FeatureType#getNamespace()
238:            //     */
239:            //    public URI getNamespaceURI() {
240:            //        return featureClass.getNamespaceURI();
241:            //    }
242:
243:            /* (non-Javadoc)
244:             * @see org.geotools.feature.FeatureType#getTypeName()
245:             */
246:            public String getTypeName() {
247:                return typeName;
248:            }
249:
250:            /* (non-Javadoc)
251:             * @see org.geotools.feature.FeatureType#hasAttributeType(java.lang.String)
252:             */
253:            public boolean hasAttributeType(String xPath) {
254:                return featureClass.hasAttributeType(xPath);
255:            }
256:
257:            /* (non-Javadoc)
258:             * @see org.geotools.feature.FeatureType#isAbstract()
259:             */
260:            public boolean isAbstract() {
261:                return featureClass.isAbstract();
262:            }
263:
264:            /* (non-Javadoc)
265:             * @see org.geotools.feature.FeatureType#isDescendedFrom(org.geotools.feature.FeatureType)
266:             */
267:            public boolean isDescendedFrom(FeatureType type) {
268:                return featureClass.isDescendedFrom(type);
269:            }
270:
271:            /* (non-Javadoc)
272:             * @see org.geotools.feature.FeatureType#isDescendedFrom(java.lang.String, java.lang.String)
273:             */
274:            public boolean isDescendedFrom(URI nsURI, String typeName) {
275:                return featureClass.isDescendedFrom(nsURI, typeName);
276:            }
277:
278:            /**
279:             * The FACC code, a two-letter, 3-number code
280:             * identifying the feature type
281:             * @return Returns the FACC Code.
282:             */
283:            public String getFaccCode() {
284:                return faccCode;
285:            }
286:
287:            /* (non-Javadoc)
288:             * @see org.geotools.feature.FeatureType#find(java.lang.String)
289:             */
290:            public int find(String attName) {
291:                return featureClass.find(attName);
292:            }
293:
294:            public boolean equals(Object obj) {
295:                return featureClass.equals(obj);
296:            }
297:
298:            public int hashCode() {
299:                return featureClass.hashCode();
300:            }
301:
302:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.