public class

NAFeaturesAsFeature

extends Object
implements NAFeatures
java.lang.Object
   ↳ com.esri.core.tasks.na.NAFeaturesAsFeature

Class Overview

Class containing a set of stops, facilities, incidents, or barriers, represented as Graphics. For stops, users may use StopGraphic for further convenience. May also use a URL to query a FeatureLayer

Summary

Public Constructors
NAFeaturesAsFeature()
Empty constructor
NAFeaturesAsFeature(List<Graphic> features)
Constructor taking the list of graphics
NAFeaturesAsFeature(List<Graphic> features, boolean hasZ, boolean doNotLocateOnRestrictedElements)
Constructor taking the list of graphics, as well as booleans to indicate inclusion of z values and whether or not restricted elements should be eligible to be located on
NAFeaturesAsFeature(String url)
Constructor taking a url for querying features
NAFeaturesAsFeature(String url, boolean hasZ, boolean doNotLocateOnRestrictedElements)
Constructor taking url for query features, as well as booleans to indicate inclusion of z values and whether or not restricted elements should be eligible to be located on
Public Methods
void addFeature(Graphic feature)
Adds a graphic to the list of graphics NOTE: StopGraphic may also be used here
void addFeature(StopGraphic feature)
Adds a StopGraphic to the list of graphics
void addFeatures(StopGraphic[] features)
Adds a a collection of StopGraphic to the list of graphics
void addFeatures(Graphic[] features)
Adds a collection of graphics to the list of graphics NOTE: StopGraphic may also be used here
void clearFeatures()
Clears out the list of graphics
boolean equals(Object obj)
List<Graphic> getFeatures()
Retrieves the list of graphics
SpatialReference getSpatialReference()
Gets the spatial reference to use for translating the graphics to json
String getURL()
Gets the url for the querying a FeatureLayer (query built into url)
int hashCode()
boolean isCompressedRequest()
Gets whether or not to send point stops/barriers in a compressed format NOTE: This can only be used for POINT graphics.
Boolean isDoNotLocateOnRestrictedElements()
Gets whether or not to consider restricted elements when locating
boolean isHasZ()
Gets whether or not these geometries contain z values
void setCompressedRequest(boolean compressedRequest)
Sets whether or not to send point stops/barriers in a compressed format NOTE: This can only be used for POINT graphics.
void setDoNotLocateOnRestrictedElements(Boolean doNotLocateOnRestrictedElements)
Sets whether or not to consider restricted elements when locating
void setFeatures(Graphic[] features)
Overwrites the current list of graphics NOTE: StopGraphic may also be used here
void setFeatures(StopGraphic[] features)
Overwrites the current list of graphics
void setHasZ(boolean hasZ)
Sets whether or not these geometries contain z values
void setSpatialReference(SpatialReference spatialRef)
Sets the spatial reference to use for translating the graphics to json
void setURL(String url)
Sets the url for the querying a FeatureLayer (query built into url)
String toJson()
Translates all fields into a JSON object representation
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.esri.core.tasks.na.NAFeatures

Public Constructors

public NAFeaturesAsFeature ()

Empty constructor

public NAFeaturesAsFeature (List<Graphic> features)

Constructor taking the list of graphics

Parameters
features List: The list of graphics

public NAFeaturesAsFeature (List<Graphic> features, boolean hasZ, boolean doNotLocateOnRestrictedElements)

Constructor taking the list of graphics, as well as booleans to indicate inclusion of z values and whether or not restricted elements should be eligible to be located on

Parameters
features List: The list of graphics
hasZ boolean: true if graphics contain z values
doNotLocateOnRestrictedElements boolean: true if restricted elements should be ignored

public NAFeaturesAsFeature (String url)

Constructor taking a url for querying features

Parameters
url String: The url for the FeatureLayer (query built into url)

public NAFeaturesAsFeature (String url, boolean hasZ, boolean doNotLocateOnRestrictedElements)

Constructor taking url for query features, as well as booleans to indicate inclusion of z values and whether or not restricted elements should be eligible to be located on

Parameters
url String: The url for the FeatureLayer (query built into url)
hasZ boolean: true if graphics contain z values
doNotLocateOnRestrictedElements boolean: true if restricted elements should be ignored

Public Methods

public void addFeature (Graphic feature)

Adds a graphic to the list of graphics NOTE: StopGraphic may also be used here

Parameters
feature Graphic: The graphic to add

public void addFeature (StopGraphic feature)

Adds a StopGraphic to the list of graphics

Parameters
feature StopGraphic: The StopGraphic to add

public void addFeatures (StopGraphic[] features)

Adds a a collection of StopGraphic to the list of graphics

Parameters
features StopGraphic: The collection of StopGraphics to add

public void addFeatures (Graphic[] features)

Adds a collection of graphics to the list of graphics NOTE: StopGraphic may also be used here

Parameters
features Graphic: The collection of graphics to add

public void clearFeatures ()

Clears out the list of graphics

public boolean equals (Object obj)

Parameters
obj Object
Returns
boolean

public List<Graphic> getFeatures ()

Retrieves the list of graphics

Returns
List<Graphic> List the list of graphics

public SpatialReference getSpatialReference ()

Gets the spatial reference to use for translating the graphics to json

Returns
SpatialReference SpatialReference the spatial reference to use for translating the graphics to json

public String getURL ()

Gets the url for the querying a FeatureLayer (query built into url)

Returns
String String the url for the querying a FeatureLayer (query built into url)

public int hashCode ()

Returns
int

public boolean isCompressedRequest ()

Gets whether or not to send point stops/barriers in a compressed format NOTE: This can only be used for POINT graphics.

Returns
boolean the compressedRequest true to send in compressed format

public Boolean isDoNotLocateOnRestrictedElements ()

Gets whether or not to consider restricted elements when locating

Returns
Boolean boolean true if restricted elements should be considered

public boolean isHasZ ()

Gets whether or not these geometries contain z values

Returns
boolean boolean true if geometries contain z values

public void setCompressedRequest (boolean compressedRequest)

Sets whether or not to send point stops/barriers in a compressed format NOTE: This can only be used for POINT graphics.

Parameters
compressedRequest boolean: true to send in compressed format

public void setDoNotLocateOnRestrictedElements (Boolean doNotLocateOnRestrictedElements)

Sets whether or not to consider restricted elements when locating

Parameters
doNotLocateOnRestrictedElements Boolean: true if restricted elements should be considered

public void setFeatures (Graphic[] features)

Overwrites the current list of graphics NOTE: StopGraphic may also be used here

Parameters
features Graphic: The graphics that should override the current graphics

public void setFeatures (StopGraphic[] features)

Overwrites the current list of graphics

Parameters
features StopGraphic: The StopGraphics that should override the current graphics

public void setHasZ (boolean hasZ)

Sets whether or not these geometries contain z values

Parameters
hasZ boolean: true if geometry contains z values

public void setSpatialReference (SpatialReference spatialRef)

Sets the spatial reference to use for translating the graphics to json

Parameters
spatialRef SpatialReference: the spatial reference to use for translating the graphics to json

public void setURL (String url)

Sets the url for the querying a FeatureLayer (query built into url)

Parameters
url String: the url for the querying a FeatureLayer (query built into url)

public String toJson ()

Translates all fields into a JSON object representation

Returns
String String the JSON representation
Throws
Exception