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