public final class

QueryParameters

extends Object
java.lang.Object
   ↳ com.esri.arcgisruntime.data.QueryParameters

Class Overview

Represents the input parameters for a query.

Summary

Nested Classes
class QueryParameters.OrderBy Represents the field the results are sorted by, and the sort order. 
enum QueryParameters.SortOrder Represents the the order in which results of a query are sorted. 
enum QueryParameters.SpatialRelationship Defines the spatial relationship between the geometry set on QueryParameters and the geometry of a feature table's feature. 
Public Constructors
QueryParameters()
Creates a new instance.
Public Methods
Geometry getGeometry()
Gets the geometry that will be used to perform a spatial query, along with the indicated spatial relationship.
SpatialReference getInSpatialReference()
Gets the spatial reference of the set geometry.
double getMaxAllowableOffset()
Gets the maximum allowable offset used for generalizing geometries returned by the query operation.
int getMaxFeatures()
Gets the maximum number of features to be included in the result.
List<Long> getObjectIds()
Gets a mutable list of object IDs of the features to be queried.
List<QueryParameters.OrderBy> getOrderByFields()
Gets a mutable list of OrderBy objects, indicating the fields the results are sorted by, and the order in which they are sorted.
SpatialReference getOutSpatialReference()
Gets the spatial reference of the feature geometry in the result.
int getResultOffset()
Gets the offset of results to fetch.
QueryParameters.SpatialRelationship getSpatialRelationship()
Gets the spatial relationship.
TimeExtent getTimeExtent()
Returns the time extent of the query.
String getWhereClause()
Gets the where clause; which is a legal SQL statement.
boolean isReturnGeometry()
Gets whether geometries of features are returned in the query result.
void setGeometry(Geometry geometry)
Sets the geometry that will be used to perform a spatial query, along with the indicated spatial relationship.
void setMaxAllowableOffset(double maxAllowableOffset)
Sets the maximum allowable offset used for generalizing geometries returned by the query operation.
void setMaxFeatures(int maxFeatures)
Sets the maximum number of features to be included in the result.
void setOutSpatialReference(SpatialReference outSR)
Sets the spatial reference of the feature geometry in the result.
void setResultOffset(int resultOffset)
Sets the offset of results to fetch.
void setReturnGeometry(boolean returnGeometry)
Sets whether to return geometries of features in the query result.
void setSpatialRelationship(QueryParameters.SpatialRelationship spatialRelationship)
Sets the spatial relationship to compare a given geometry to the geometry of a feature table's feature.
void setTimeExtent(TimeExtent timeExtent)
Sets the time extent of the query.
void setWhereClause(String whereClause)
Sets the where clause.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public QueryParameters ()

Creates a new instance.

Public Methods

public Geometry getGeometry ()

Gets the geometry that will be used to perform a spatial query, along with the indicated spatial relationship.

Returns
  • the the geometry to use.

public SpatialReference getInSpatialReference ()

Gets the spatial reference of the set geometry.

Returns
  • the spatial reference of the set geometry. If no geometry is set, then null.

public double getMaxAllowableOffset ()

Gets the maximum allowable offset used for generalizing geometries returned by the query operation. The default is 0. If 0 is specified the value is not passed to the server in the query operation. The offset is in the units of the outSpatialReference. If an outSpatialReference is not defined, the spatial reference of the service is used.

Returns
  • the maximum allowable offset

public int getMaxFeatures ()

Gets the maximum number of features to be included in the result.

Returns
  • the maximum number of features to be included in the result.

public List<Long> getObjectIds ()

Gets a mutable list of object IDs of the features to be queried. By default this list is empty. Add to this list to query for an object ID.

Returns
  • the object IDs of the features to be queried

public List<QueryParameters.OrderBy> getOrderByFields ()

Gets a mutable list of OrderBy objects, indicating the fields the results are sorted by, and the order in which they are sorted. By default this list is empty. Add instances of OrderBy to this list to sort the query result.

Returns
  • a mutable list of OrderBy objects

public SpatialReference getOutSpatialReference ()

Gets the spatial reference of the feature geometry in the result.

Returns
  • the spatial reference of the feature geometry in the result

public int getResultOffset ()

Gets the offset of results to fetch.

If providing a result offset to support paging of results, you must also set a maximum features value. If result offset is set, but maximum features is not, the offset will be ignored.

Returns
  • the offset of results to fetch

public QueryParameters.SpatialRelationship getSpatialRelationship ()

Gets the spatial relationship.

Returns
  • the spatial relationship.

public TimeExtent getTimeExtent ()

Returns the time extent of the query.

Returns
  • the time extent, or null if no time extent is set

public String getWhereClause ()

Gets the where clause; which is a legal SQL statement.

Returns
  • the where clause

public boolean isReturnGeometry ()

Gets whether geometries of features are returned in the query result.

Returns
  • true if geometries are returned in the result; false otherwise

public void setGeometry (Geometry geometry)

Sets the geometry that will be used to perform a spatial query, along with the indicated spatial relationship. This can be used in addition to an attribute query. hasGeometry() must be true to use this method.

Parameters
geometry the geometry to use.
Throws
IllegalArgumentException if input is null

public void setMaxAllowableOffset (double maxAllowableOffset)

Sets the maximum allowable offset used for generalizing geometries returned by the query operation. The default is 0. If 0 is specified the value is not passed to the server in the query operation. The offset is in the units of the outSpatialReference. If an outSpatialReference is not defined, the spatial reference of the service is used.

Parameters
maxAllowableOffset the maximum allowable offset

public void setMaxFeatures (int maxFeatures)

Sets the maximum number of features to be included in the result. If 0, then there is no limit set on the number of features.

Parameters
maxFeatures the maximum number of features to be included in the result
Throws
IllegalArgumentException if input is less than 0

public void setOutSpatialReference (SpatialReference outSR)

Sets the spatial reference of the feature geometry in the result.

Parameters
outSR the spatial reference of the feature geometry in the result. If null, then the output spatial reference is same as the spatial reference of the input geometry.

public void setResultOffset (int resultOffset)

Sets the offset of results to fetch.

If providing a result offset to support paging of results, you must also set a maximum features value. If result offset is set, but maximum features is not, the offset will be ignored.

For consistent ordering of results, include a QueryParameters.OrderBy in the list provided by getOrderByFields().

Parameters
resultOffset the offset of results to fetch

public void setReturnGeometry (boolean returnGeometry)

Sets whether to return geometries of features in the query result. By default, is true. Excluding geometries may be recommended for queries to a service in order to reduce the amount of information received over a network.

Parameters
returnGeometry true to return geometries in the result; otherwise false.

public void setSpatialRelationship (QueryParameters.SpatialRelationship spatialRelationship)

Sets the spatial relationship to compare a given geometry to the geometry of a feature table's feature.

Parameters
spatialRelationship the spatial relationship
Throws
IllegalArgumentException if input is null

public void setTimeExtent (TimeExtent timeExtent)

Sets the time extent of the query. The time extent can be null to indicate an infinite extent.

Parameters
timeExtent the time extent

public void setWhereClause (String whereClause)

Sets the where clause. Any legal SQL where clause operating on the fields in the layer/table is allowed, for example 'POP2000 > 500000'.

Parameters
whereClause the where clause. May be null or empty.