org.vfny.geoserver.requests
Class Query

java.lang.Object
  extended byorg.vfny.geoserver.requests.Query

public class Query
extends java.lang.Object

Provides an internal, generic representation of a query component to a Feature request. Note that Feature requests can contain multiple query components and that the 'version' inside the query component is different than the 'version' of the GetFeature request.


Field Summary
protected  boolean allRequested
          Flags whether or not all properties were requested
protected  org.geotools.filter.Filter filter
          The filter for the query
protected  java.lang.String handle
          The user-specified name for the query.
protected  java.util.List propertyNames
          The property names requested
protected  java.lang.String typeName
          The feature type name requested.
protected  java.lang.String version
          The version of the feature to request - current implementation ignores entirely.
 
Constructor Summary
Query()
          Empty constructor.
 
Method Summary
 void addFilter(org.geotools.filter.Filter filter)
          Sets the filter for the query.
 void addPropertyName(java.lang.String propertyName)
          Adds a requested property name to the query.
 boolean allRequested()
          Return boolean for all requested types.
 boolean equals(java.lang.Object obj)
          Override of equals.
 org.geotools.data.Query getDataSourceQuery(int maxFeatures)
          Gets this query as a geotools Query object.
 org.geotools.filter.Filter getFilter()
          Gets the filter for this query.
 java.lang.String getHandle()
          Gets the user-defined 'handle' for the query.
 java.util.List getPropertyNames()
          Gets the requested property names as a list.
 java.lang.String getTypeName()
          Gets the feature type name for this query.
 java.lang.String getVersion()
          Gets the 'version' of features to retrieve.
 int hashCode()
          Override of hashCode.
 void setHandle(java.lang.String handle)
          Sets the user-defined 'handle' for the query.
 void setTypeName(java.lang.String typeName)
          Sets the feature type name for this query.
 void setVersion(java.lang.String version)
          Sets the 'version' of features to retrieve.
 org.geotools.data.Query toDataQuery(int maxFeatures)
          Get this query as a geotools Query.
 java.lang.String toString()
          Override of toString.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

handle

protected java.lang.String handle
The user-specified name for the query.


version

protected java.lang.String version
The version of the feature to request - current implementation ignores entirely.


typeName

protected java.lang.String typeName
The feature type name requested.


propertyNames

protected java.util.List propertyNames
The property names requested


filter

protected org.geotools.filter.Filter filter
The filter for the query


allRequested

protected boolean allRequested
Flags whether or not all properties were requested

Constructor Detail

Query

public Query()
Empty constructor.

Method Detail

getPropertyNames

public java.util.List getPropertyNames()
Gets the requested property names as a list.

Returns:
A list of the names of the requested properties.

setTypeName

public void setTypeName(java.lang.String typeName)
Sets the feature type name for this query.

Parameters:
typeName - The featureType to query.

getTypeName

public java.lang.String getTypeName()
Gets the feature type name for this query.

Returns:
The featureType to query.

addPropertyName

public void addPropertyName(java.lang.String propertyName)
Adds a requested property name to the query.

Parameters:
propertyName - The name of a property to return.

allRequested

public boolean allRequested()
Return boolean for all requested types.

Returns:
true if all properties are requested.

setHandle

public void setHandle(java.lang.String handle)
Sets the user-defined 'handle' for the query.

Parameters:
handle - The mnemonic handle to associate with this query.

getHandle

public java.lang.String getHandle()
Gets the user-defined 'handle' for the query.

Returns:
The mnemonic handle associatee with this query.

setVersion

public void setVersion(java.lang.String version)
Sets the 'version' of features to retrieve. Not currently used.

Parameters:
version - The feature version to retrieve.

getVersion

public java.lang.String getVersion()
Gets the 'version' of features to retrieve.

Returns:
The feature version to retrieve.

addFilter

public void addFilter(org.geotools.filter.Filter filter)
Sets the filter for the query.

Parameters:
filter - The ogc filter to narrow the results.

getFilter

public org.geotools.filter.Filter getFilter()
Gets the filter for this query.

Returns:
The ogc filter to narrow the results.

getDataSourceQuery

public org.geotools.data.Query getDataSourceQuery(int maxFeatures)
Gets this query as a geotools Query object.

Parameters:
maxFeatures - The max number of Features to return.
Returns:
A geotools query object representing this Query with the passed in maxFeatures.

toDataQuery

public org.geotools.data.Query toDataQuery(int maxFeatures)
Get this query as a geotools Query.

if maxFeatures is a not positive value DefaultQuery.DEFAULT_MAX will be used.

The method name is changed to toDataStoreQuery since this is a one way conversion.

Parameters:
maxFeatures - number of features, or 0 for DefaultQuery.DEFAULT_MAX
Returns:
A Query for use with the FeatureSource interface

toString

public java.lang.String toString()
Override of toString.

Returns:
String representation of this query.

equals

public boolean equals(java.lang.Object obj)
Override of equals.

Parameters:
obj - the object to compare against.
Returns:
true if obj is equal to this Query.

hashCode

public int hashCode()
Override of hashCode.

Returns:
an int to hash this Query with.