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


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2002-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;
009:         *    version 2.1 of the License.
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:        package org.geotools.data;
017:
018:        import java.net.URI;
019:        import java.util.Arrays;
020:        import org.opengis.filter.Filter;
021:        import org.opengis.filter.sort.SortBy;
022:        import org.opengis.referencing.crs.CoordinateReferenceSystem;
023:        import org.geotools.factory.GeoTools;
024:        import org.geotools.factory.Hints;
025:
026:        /**
027:         * Implementation for Query.FIDS.
028:         *
029:         * <p>
030:         * This query is used to retrive FeatureIds. Query.FIDS is the only instance of
031:         * this class.
032:         * </p>
033:         *
034:         * <p>
035:         * Example:
036:         * </p>
037:         * <pre><code>
038:         * featureSource.getFeatures( Query.FIDS );
039:         * </code></pre>
040:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/data/FIDSQuery.java $
041:         */
042:        class FIDSQuery implements  Query {
043:            static final String[] NO_PROPERTIES = new String[0];
044:
045:            public String[] getPropertyNames() {
046:                return NO_PROPERTIES;
047:            }
048:
049:            public boolean retrieveAllProperties() {
050:                return false;
051:            }
052:
053:            public int getMaxFeatures() {
054:                return DEFAULT_MAX; // consider Integer.MAX_VALUE
055:            }
056:
057:            public Filter getFilter() {
058:                return Filter.INCLUDE;
059:            }
060:
061:            public String getTypeName() {
062:                return null;
063:            }
064:
065:            public URI getNamespace() {
066:                return NO_NAMESPACE;
067:            }
068:
069:            public String getHandle() {
070:                return "Request Feature IDs";
071:            }
072:
073:            public String getVersion() {
074:                return null;
075:            }
076:
077:            /**
078:             * Hashcode based on propertyName, maxFeatures and filter.
079:             *
080:             * @return hascode for filter
081:             */
082:            public int hashCode() {
083:                String[] n = getPropertyNames();
084:
085:                return ((n == null) ? (-1) : ((n.length == 0) ? 0
086:                        : (n.length | n[0].hashCode())))
087:                        | getMaxFeatures()
088:                        | ((getFilter() == null) ? 0 : getFilter().hashCode())
089:                        | ((getTypeName() == null) ? 0 : getTypeName()
090:                                .hashCode())
091:                        | ((getVersion() == null) ? 0 : getVersion().hashCode())
092:                        | ((getCoordinateSystem() == null) ? 0
093:                                : getCoordinateSystem().hashCode())
094:                        | ((getCoordinateSystemReproject() == null) ? 0
095:                                : getCoordinateSystemReproject().hashCode());
096:            }
097:
098:            /**
099:             * Equality based on propertyNames, maxFeatures, filter, typeName and
100:             * version.
101:             *
102:             * <p>
103:             * Changing the handle does not change the meaning of the Query.
104:             * </p>
105:             *
106:             * @param obj Other object to compare against
107:             *
108:             * @return <code>true</code> if <code>obj</code> retrieves only FIDS
109:             */
110:            public boolean equals(Object obj) {
111:                if ((obj == null) || !(obj instanceof  Query)) {
112:                    return false;
113:                }
114:
115:                if (this  == obj) {
116:                    return true;
117:                }
118:
119:                Query other = (Query) obj;
120:
121:                return Arrays.equals(getPropertyNames(), other
122:                        .getPropertyNames())
123:                        && (retrieveAllProperties() == other
124:                                .retrieveAllProperties())
125:                        && (getMaxFeatures() == other.getMaxFeatures())
126:                        && ((getFilter() == null) ? (other.getFilter() == null)
127:                                : getFilter().equals(other.getFilter()))
128:                        && ((getTypeName() == null) ? (other.getTypeName() == null)
129:                                : getTypeName().equals(other.getTypeName()))
130:                        && ((getVersion() == null) ? (other.getVersion() == null)
131:                                : getVersion().equals(other.getVersion()))
132:                        && ((getCoordinateSystem() == null) ? (other
133:                                .getCoordinateSystem() == null)
134:                                : getCoordinateSystem().equals(
135:                                        other.getCoordinateSystem()))
136:                        && ((getCoordinateSystemReproject() == null) ? (other
137:                                .getCoordinateSystemReproject() == null)
138:                                : getCoordinateSystemReproject().equals(
139:                                        other.getCoordinateSystemReproject()));
140:            }
141:
142:            public String toString() {
143:                return "Query.FIDS";
144:            }
145:
146:            /**
147:             * Return <code>null</code> as FIDSQuery does not require a CS.
148:             *
149:             * @return <code>null</code> as override is not required.
150:             *
151:             * @see org.geotools.data.Query#getCoordinateSystem()
152:             */
153:            public CoordinateReferenceSystem getCoordinateSystem() {
154:                return null;
155:            }
156:
157:            /**
158:             * Return <code>null</code> as FIDSQuery does not require a CS.
159:             *
160:             * @return <code>null</code> as reprojection is not required.
161:             *
162:             * @see org.geotools.data.Query#getCoordinateSystemReproject()
163:             */
164:            public CoordinateReferenceSystem getCoordinateSystemReproject() {
165:                return null;
166:            }
167:
168:            /**
169:             * @return {@link SortBy#UNSORTED}.
170:             */
171:            public SortBy[] getSortBy() {
172:                return SortBy.UNSORTED;
173:            }
174:
175:            /**
176:             * Returns the GeoTools default hints {@link GeoTools#getDefaultHints()}
177:             */
178:            public Hints getHints() {
179:                return GeoTools.getDefaultHints();
180:            }
181:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.