public abstract class

FeatureResult

extends Object
implements Iterable<Object>
java.lang.Object
   ↳ com.esri.core.map.FeatureResult

Class Overview

This class encapsulates a set of features and their metadata. The set of features could be obtained as a result of some query operation, for instance, using a QueryTask or querying features in a GeodatabaseFeatureTable. The features can be accessed through an iterator (iterator()) which can be used in an enhanced for-loop.

The iterator iterates through elements of type Object. The specific type depends on the operation.
For example, the Object element is of type:

Example:

 Future<FeatureResult> result = ...; // query features, for example, from GeodatabaseFeatureTable.queryFeatures() 
 for (Object element : result.get()) {
   if (element instanceof Feature) {
     // element is of type Feature for queries without out-statistics
     Feature f = (Feature) element;
     // ...
   } else if (element instanceof Map<String, Object>) {
     // element is of type Map<String, Object> for queries with out-statistics
     Map<String, Object> f = (Map<String, Object>) element;
     f.get(<out-statistic field name>);
     // ...
   }
 }
 

Summary

Public Constructors
FeatureResult(Iterator<Object> iterator)
Initializes the result with an iterator.
FeatureResult()
Initializer without an iterator.
Public Methods
abstract long featureCount()
Returns the total number of features in the result.
String getDisplayFieldName()
List<Field> getFields()
Gets the fields in the return feature result.
String getObjectIdFieldName()
boolean isExceededTransferLimit()
Checks to see if the FeatureResult returned from the query exceeded the transfer limit.
Iterator<Object> iterator()
Returns the iterator of the result.
Protected Methods
void setDisplayFieldName(String displayFieldName)
void setExceededTransferLimit(boolean exceededTransferLimit)
Sets whether or not the transfer limit was exceeded
void setFields(List<Field> fields)
Sets the fields.
void setObjectIdFieldName(String objectIdFieldName)
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Iterable

Public Constructors

public FeatureResult (Iterator<Object> iterator)

Initializes the result with an iterator.

Parameters
iterator Iterator: iterator of Object

public FeatureResult ()

Initializer without an iterator.

Public Methods

public abstract long featureCount ()

Returns the total number of features in the result.

Returns
long total number of features, 0 by default.

public String getDisplayFieldName ()

Returns
String the name of a feature that is used as the default display field.

public List<Field> getFields ()

Gets the fields in the return feature result.

Returns
List<Field> the fields in the feature result.

public String getObjectIdFieldName ()

Returns
String name of field that represents the object id

public boolean isExceededTransferLimit ()

Checks to see if the FeatureResult returned from the query exceeded the transfer limit.

Returns
boolean true if the transfer limit was exceeded

public Iterator<Object> iterator ()

Returns the iterator of the result.

Returns
Iterator<Object>

Protected Methods

protected void setDisplayFieldName (String displayFieldName)

Parameters
displayFieldName String: the field name to be used as the display field.

protected void setExceededTransferLimit (boolean exceededTransferLimit)

Sets whether or not the transfer limit was exceeded

Parameters
exceededTransferLimit boolean: whether the transfer limit was exceeded

protected void setFields (List<Field> fields)

Sets the fields.

protected void setObjectIdFieldName (String objectIdFieldName)

Parameters
objectIdFieldName String: the name of the field that represents the object id.