Java Doc for DefaultQuery.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 Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.data.DefaultQuery

DefaultQuery
public class DefaultQuery implements Query(Code)
The query object is used by the FeatureSource.getFeatures method of the DataSource interface, to encapsulate a request. It defines which feature type to query, what properties to retrieve and what constraints (spatial and non-spatial) to apply to those properties. It is designed to closesly match a WFS Query element of a getFeatures request. The only difference is the addition of the maxFeatures element, which allows more control over the features selected. It allows a full getFeatures request to properly control how many features it gets from each query, instead of requesting and discarding when the max is reached.
author:
   Chris Holmes



Constructor Summary
public  DefaultQuery()
     /** No argument constructor.
public  DefaultQuery(String typeName)
     Query with typeName.
public  DefaultQuery(String typeName, Filter filter)
     Constructor with typeName and filter.
public  DefaultQuery(String typeName, Filter filter, String[] properties)
    
public  DefaultQuery(String typeName, Filter filter, int maxFeatures, String[] propNames, String handle)
     Constructor that sets all fields.
public  DefaultQuery(String typeName, URI namespace, Filter filter, int maxFeatures, String[] propNames, String handle)
     Constructor that sets all fields.
public  DefaultQuery(Query query)
    

Method Summary
public  booleanequals(Object obj)
     Equality based on propertyNames, maxFeatures, filter, typeName and version.
public  CoordinateReferenceSystemgetCoordinateSystem()
     getCoordinateSystem purpose.
public  CoordinateReferenceSystemgetCoordinateSystemReproject()
     getCoordinateSystemReproject purpose.
public  FiltergetFilter()
     The Filter can be used to define constraints on a query.
public  StringgetHandle()
     The handle attribute is included to allow a client to associate a mnemonic name to the Query request.
public  HintsgetHints()
    
public  intgetMaxFeatures()
     The optional maxFeatures can be used to limit the number of features that a query request retrieves.
public  URIgetNamespace()
    
public  String[]getPropertyNames()
     The property names is used to specify the attributes that should be selected for the return feature collection.
public  SortBy[]getSortBy()
     Retrive list of SortBy information.
public  StringgetTypeName()
     The typeName attribute is used to indicate the name of the feature type to be queried.
public  StringgetVersion()
     From WFS Spec: The version attribute is included in order to accommodate systems that support feature versioning.
public  inthashCode()
     Hashcode based on propertyName, maxFeatures and filter.
public  booleanretrieveAllProperties()
     Convenience method to determine if the query should use the full schema (all properties) of the data source for the features returned.
public  voidsetCoordinateSystem(CoordinateReferenceSystem system)
     setCoordinateSystem purpose.
public  voidsetCoordinateSystemReproject(CoordinateReferenceSystem system)
     setCoordinateSystemReproject purpose.
public  voidsetFilter(Filter filter)
     Sets the filter to constrain the query.
public  voidsetHandle(String handle)
     Sets a mnemonic name for the query request.
public  voidsetHints(Hints hints)
    
public  voidsetMaxFeatures(int maxFeatures)
     Sets the max features to retrieved by this query.
public  voidsetPropertyNames(String[] propNames)
     Sets the properties to retrieve from the db.
public  voidsetPropertyNames(List propNames)
     Sets the proper attributeTypes constructed from a schema and a list of propertyNames.
Parameters:
  propNames - the names of the properties to check against theschema.
public  voidsetSortBy(SortBy[] sortBy)
     Sets the sort by information.
public  voidsetTypeName(String typeName)
     Sets the typename.
public  voidsetVersion(String version)
    
public  StringtoString()
    


Constructor Detail
DefaultQuery
public DefaultQuery()(Code)
/** No argument constructor.



DefaultQuery
public DefaultQuery(String typeName)(Code)
Query with typeName.


Parameters:
  typeName - the name of the featureType to retrieve



DefaultQuery
public DefaultQuery(String typeName, Filter filter)(Code)
Constructor with typeName and filter. Note that current datasource implementations only have one type per datasource, so the typeName field will likely be ignored.
Parameters:
  typeName - the name of the featureType to retrieve.
Parameters:
  filter - the OGC filter to constrain the request.



DefaultQuery
public DefaultQuery(String typeName, Filter filter, String[] properties)(Code)
Constructor that sets the filter and properties
Parameters:
  typeName -
Parameters:
  filter - the OGC filter to constrain the request.
Parameters:
  properties - an array of the properties to fetch.



DefaultQuery
public DefaultQuery(String typeName, Filter filter, int maxFeatures, String[] propNames, String handle)(Code)
Constructor that sets all fields.
Parameters:
  typeName - the name of the featureType to retrieve.
Parameters:
  filter - the OGC filter to constrain the request.
Parameters:
  maxFeatures - the maximum number of features to be returned.
Parameters:
  propNames - an array of the properties to fetch.
Parameters:
  handle - the name to associate with the query.



DefaultQuery
public DefaultQuery(String typeName, URI namespace, Filter filter, int maxFeatures, String[] propNames, String handle)(Code)
Constructor that sets all fields.
Parameters:
  typeName - the name of the featureType to retrieve.
Parameters:
  namespace - Namespace for provided typeName, or null if unspecified
Parameters:
  filter - the OGC filter to constrain the request.
Parameters:
  maxFeatures - the maximum number of features to be returned.
Parameters:
  propNames - an array of the properties to fetch.
Parameters:
  handle - the name to associate with the query.



DefaultQuery
public DefaultQuery(Query query)(Code)
Copy contructor, clones the state of a generic Query into a DefaultQuery
Parameters:
  query -




Method Detail
equals
public boolean equals(Object obj)(Code)
Equality based on propertyNames, maxFeatures, filter, typeName and version.

Changing the handle does not change the meaning of the Query.


Parameters:
  obj - Other object to compare against true if obj matches this filter



getCoordinateSystem
public CoordinateReferenceSystem getCoordinateSystem()(Code)
getCoordinateSystem purpose.

Description ...




getCoordinateSystemReproject
public CoordinateReferenceSystem getCoordinateSystemReproject()(Code)
getCoordinateSystemReproject purpose.

Description ...




getFilter
public Filter getFilter()(Code)
The Filter can be used to define constraints on a query. If no Filter is present then the query is unconstrained and all feature instances should be retrieved. The filter that defines constraints on the query.



getHandle
public String getHandle()(Code)
The handle attribute is included to allow a client to associate a mnemonic name to the Query request. The purpose of the handle attribute is to provide an error handling mechanism for locating a statement that might fail. the mnemonic name of the query request.



getHints
public Hints getHints()(Code)



getMaxFeatures
public int getMaxFeatures()(Code)
The optional maxFeatures can be used to limit the number of features that a query request retrieves. If no maxFeatures is specified then all features should be returned.

This is the only method that is not directly out of the Query element in the WFS spec. It is instead a part of a getFeatures request, which can hold one or more queries. But each of those in turn will need a maxFeatures, so it is needed here.

the max features the getFeature call should return.



getNamespace
public URI getNamespace()(Code)



getPropertyNames
public String[] getPropertyNames()(Code)
The property names is used to specify the attributes that should be selected for the return feature collection. If the property array is null, then the datasource should return all available properties, its full schema. If an array of specified then the full schema should be used (all property names). The property names can be determined with a getSchema call from the DataSource interface.

This replaces our funky setSchema method of retrieving select properties. I think it makes it easier to understand how to get certain properties out of the datasource, instead of having users get the schema and then compose a new schema using the attributes that they want. The old way was also giving me problems because I couldn't have multiple object reuse the same datasource object, since some other object could come along and change its schema, and would then return the wrong properties.

the property names to be used in the returned FeatureCollection.



getSortBy
public SortBy[] getSortBy()(Code)
Retrive list of SortBy information.

Note we are using SortBy2, to be standards complient you may limit yourself to to SortBy information.




getTypeName
public String getTypeName()(Code)
The typeName attribute is used to indicate the name of the feature type to be queried.

The DataStore API does not assume one feature type per datastore. It currently makes use of this field to to specify with each request what type to get.

the name of the feature type to be returned with this query.



getVersion
public String getVersion()(Code)
From WFS Spec: The version attribute is included in order to accommodate systems that support feature versioning. A value of ALL indicates that all versions of a feature should be fetched. Otherwise an integer, n, can be specified to return the n th version of a feature. The version numbers start at '1' which is the oldest version. If a version value larger than the largest version is specified then the latest version is return. The default action shall be for the query to return the latest version. Systems that do not support versioning can ignore the parameter and return the only version that they have.

This is ready for use, it will be up to data store implementors to support it.

the version of the feature to return, or null for latest.



hashCode
public int hashCode()(Code)
Hashcode based on propertyName, maxFeatures and filter. hascode for filter



retrieveAllProperties
public boolean retrieveAllProperties()(Code)
Convenience method to determine if the query should use the full schema (all properties) of the data source for the features returned. This method is equivalent to if (query.getProperties() == null), but allows for more clarity on the part of datasource implementors, so they do not need to examine and use null values. All Query implementations should return true for this function if getProperties returns null. if all datasource attributes should be included in the schemaof the returned FeatureCollection.



setCoordinateSystem
public void setCoordinateSystem(CoordinateReferenceSystem system)(Code)
setCoordinateSystem purpose.

Description ...


Parameters:
  system -



setCoordinateSystemReproject
public void setCoordinateSystemReproject(CoordinateReferenceSystem system)(Code)
setCoordinateSystemReproject purpose.

Description ...


Parameters:
  system -



setFilter
public void setFilter(Filter filter)(Code)
Sets the filter to constrain the query.
Parameters:
  filter - the OGC filter to limit the datasource getFeaturesrequest.



setHandle
public void setHandle(String handle)(Code)
Sets a mnemonic name for the query request.
Parameters:
  handle - the name to refer to this query.



setHints
public void setHints(Hints hints)(Code)
Sets the query hints
Parameters:
  hints -



setMaxFeatures
public void setMaxFeatures(int maxFeatures)(Code)
Sets the max features to retrieved by this query.
Parameters:
  maxFeatures - the maximum number of features the getFeature callshould return.



setPropertyNames
public void setPropertyNames(String[] propNames)(Code)
Sets the properties to retrieve from the db. If the boolean to load all properties is set to true then the AttributeTypes that are not in the database's schema will just be filled with null values.
Parameters:
  propNames - The names of attributes to load from the datasouce.



setPropertyNames
public void setPropertyNames(List propNames)(Code)
Sets the proper attributeTypes constructed from a schema and a list of propertyNames.
Parameters:
  propNames - the names of the properties to check against theschema. If null then all attributes will be returned. If a Listof size 0 is used then only the featureIDs should be used.



setSortBy
public void setSortBy(SortBy[] sortBy)(Code)
Sets the sort by information.



setTypeName
public void setTypeName(String typeName)(Code)
Sets the typename.
Parameters:
  typeName - the name of the featureType to retrieve.



setVersion
public void setVersion(String version)(Code)

See Also:   DefaultQuery.getVersion()
Parameters:
  version -
since:
   2.4



toString
public String toString()(Code)
Over ride of toString a string representation of this query object.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.