Packagecom.esri.aws.services
Classpublic class ResultSetRange

The range for returned records based on the startIndex and count values. Used with Address Finder, Place Finder, Report, and Spatial Query.

View the examples.



Public Properties
 PropertyDefined by
  count : int
The number of records to return.
ResultSetRange
  startIndex : int
The number of records to skip in the query.
ResultSetRange
Property detail
countproperty
public var count:int

The number of records to return. Each data source has a maximum count. For most data sources, the maximum count is "1000", but some are less. Value cannot exceed "1000".

The default value is 20.

startIndexproperty 
public var startIndex:int

The number of records to skip in the query. The first record is always 0. For example, to get records 11-15, set startIndex to "10".

The default value is 0.

Examples
Basic_SpatialQuery_without_map
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:awx="http://www.arcwebservices.com/2007/awx"
    pageTitle="Basic SpatialQuery - findFeaturesByPoint()"
    implements="mx.rpc.IResponder"
    creationComplete="onComplete()"
    >
    <mx:Script>
        <![CDATA[
            import com.esri.aws.awx.geom.GeoPoint;
            import com.esri.aws.osgi.framework.ServiceTracker;
            import com.esri.aws.osgi.framework.IServiceReference;
            import com.esri.aws.services.ISpatialQuery;
            import com.esri.aws.services.ResultSet;
            import com.esri.aws.services.ResultSetRange;
            import com.esri.aws.services.SearchOptions;
            import com.esri.aws.services.SpatialQueryOptions;

            import flash.utils.getQualifiedClassName;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.rpc.IResponder;
            
            private var spatialTracker:ServiceTracker;
            
            private function onComplete():void
            {
                spatialTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(ISpatialQuery));
                spatialTracker.open();
            }

            private function doQuery():void
            {
                var spatialService:ISpatialQuery = spatialTracker.getService() as ISpatialQuery;
                
                if (spatialService)
                {
                    //build some simple options to return the closest state/province polygon
                    var sqOptions:SpatialQueryOptions = new SpatialQueryOptions();
                    sqOptions.dataSource = "ArcWeb:ESRI.AdminAreas.World";
                    sqOptions.returnDistance = true;
                    var s2:SearchOptions = new SearchOptions;
                    var s3:ResultSetRange = new ResultSetRange;
                    sqOptions.searchOptions = s2;
                    s2.resultSetRange = s3;
                    s3.count = 1;
                    spatialService.findFeaturesByPoint(new GeoPoint(-117, 33), sqOptions, this);
                }
            }
            
            public function result(data:Object):void
            {
                try {
                    var rs:ResultSet = ResultSet(data);
                    for(var j:int = 0; j < rs.rows.length; j++)
                    {
                        for(var k:int = 0; k < rs.fields.length; k++) {
                            log.htmlText += "<b>" + rs.fields[k].name + ":</b> " + rs.rows[j].fieldValues[k] + ".<br>";
                        }
                    }
                }
                catch(error:Error)
                {
                    Alert.show(error.message);
                }
            }
            
            public function fault(info:Object):void
            {
                Alert.show(info.toString());
            }
        ]]>
    </mx:Script>

    <awx:Framework id="m_framework" apiKey="[MY-API-KEY]">
        <awx:SpatialQueryActivator/>
    </awx:Framework>

    <mx:Button label="Run a SpatialQuery" click="doQuery()"/>
    <mx:Panel title="SpatialQuery Results">
        <mx:TextArea id="log" minHeight="200" minWidth="300"/>
    </mx:Panel>
</mx:Application>