com.esri.core.map
Class FeatureSet

java.lang.Object
  extended by com.esri.core.map.FeatureSet
All Implemented Interfaces:
Serializable

public class FeatureSet
extends Object
implements Serializable

A collection of features returned from ArcGIS Server or used as input to tasks. Each feature in the FeatureSet may contain geometry, attributes, symbology, and an InfoTemplate. If the FeatureSet does not contain geometry, and only contains attributes, the FeatureSet can be treated as a table where each feature is a row object. Tasks that return FeatureSet include QueryTask and GeoProcessor. In addition, GeoProcessor may require FeatureSet as input.

See Also:
Serialized Form

Constructor Summary
FeatureSet()
           
 
Method Summary
 boolean equals(Object obj)
           
static FeatureSet fromJson(org.codehaus.jackson.JsonParser parser)
          Decodes objects from JSON representation.
static FeatureSet fromJson(org.codehaus.jackson.JsonParser parser, boolean graphicsHaveSpatialRef)
          Decodes objects from JSON representation.
static FeatureSet fromJson(org.codehaus.jackson.JsonParser parser, boolean graphicsHaveSpatialRef, int maxResultsReturned)
          Decodes objects from JSON representation.
static FeatureSet fromJson(org.codehaus.jackson.JsonParser parser, int maxResults)
          Decodes objects from JSON representation.
 String getDisplayFieldName()
          Sets the name of the Display field.
 Map<String,Object> getFieldAliases()
          Gets the name alias pairs of all fields.
 List<Field> getFields()
          Gets the name of all fields.
 Geometry.Type getGeometryType()
          Gets the geometry type of the graphics.
 Graphic[] getGraphics()
          Gets the graphics in the set.
 String getObjectIdFieldName()
          Gets the name of the ObjectId field.
 Integer[] getObjectIds()
          Gets the array of the ObjectIds in the FeatureSet.
 SpatialReference getSpatialReference()
          Gets the spatial reference of the FeatureSet.
 int hashCode()
           
 void setFields(List<Field> fields)
          Sets the name of the fields.
 void setGraphics(Graphic[] graphics)
          Sets the graphics of the FeatureSet.
 void setSpatialReference(SpatialReference spatialReference)
          Sets the spatial reference of the FeatureSet.
static String toJson(FeatureSet featureSet)
          Serializes a FeatureSet object into a JSON String.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureSet

public FeatureSet()
Method Detail

getObjectIds

public Integer[] getObjectIds()
Gets the array of the ObjectIds in the FeatureSet.

Returns:
the array of ids.

getObjectIdFieldName

public String getObjectIdFieldName()
Gets the name of the ObjectId field.

Returns:
the name of the field.

getGraphics

public Graphic[] getGraphics()
Gets the graphics in the set.

Returns:
the array of graphics.

setGraphics

public void setGraphics(Graphic[] graphics)
Sets the graphics of the FeatureSet.

Parameters:
graphics - The graphics to set.

getSpatialReference

public SpatialReference getSpatialReference()
Gets the spatial reference of the FeatureSet.

Returns:
the spatial reference or null if it is not available.

setSpatialReference

public void setSpatialReference(SpatialReference spatialReference)
Sets the spatial reference of the FeatureSet.

Parameters:
spatialReference - the spatialReference to set

getGeometryType

public Geometry.Type getGeometryType()
Gets the geometry type of the graphics.

Returns:
the geometry type of the graphics.

getDisplayFieldName

public String getDisplayFieldName()
Sets the name of the Display field.

Returns:
the name of the field.

getFieldAliases

public Map<String,Object> getFieldAliases()
Gets the name alias pairs of all fields.

Returns:
the name alias pairs.

getFields

public List<Field> getFields()
Gets the name of all fields.

Returns:
the fields

setFields

public void setFields(List<Field> fields)
Sets the name of the fields.

Parameters:
fields - the fields to set

fromJson

public static FeatureSet fromJson(org.codehaus.jackson.JsonParser parser,
                                  int maxResults)
                           throws Exception
Decodes objects from JSON representation.

Parameters:
parser - the Jackson parser holding the JSON data.
Returns:
the decoded object from JSON representation.
Throws:
Exception

fromJson

public static FeatureSet fromJson(org.codehaus.jackson.JsonParser parser)
                           throws Exception
Decodes objects from JSON representation.

Parameters:
parser - the Jackson parser holding the JSON data.
Returns:
the decoded object from JSON representation.
Throws:
Exception

fromJson

public static FeatureSet fromJson(org.codehaus.jackson.JsonParser parser,
                                  boolean graphicsHaveSpatialRef)
                           throws Exception
Decodes objects from JSON representation.

Parameters:
parser - the Jackson parser holding the JSON data.
graphicsHaveSpatialRef - Whether or not the graphics contained in the FeatureSet have a SpatialReference.
Returns:
the decoded object from JSON representation.
Throws:
Exception

fromJson

public static FeatureSet fromJson(org.codehaus.jackson.JsonParser parser,
                                  boolean graphicsHaveSpatialRef,
                                  int maxResultsReturned)
                           throws Exception
Decodes objects from JSON representation.

Parameters:
parser - the Jackson parser holding the JSON data.
graphicsHaveSpatialRef - Whether or not the graphics contained in the FeatureSet have a SpatialReference.
Returns:
the decoded object from JSON representation.
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object

toJson

public static final String toJson(FeatureSet featureSet)
                           throws Exception
Serializes a FeatureSet object into a JSON String.

Parameters:
featureSet - a FeatureSet Object
Returns:
a JSON String representing the FeatureSet.
Throws:
Exception - An exception thrown the object cannot be serialized into JSON string.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2012. All Rights Reserved.