public class

NAFeaturesAsFeature

extends Object
implements NAFeatures
java.lang.Object
   ↳ com.esri.core.tasks.ags.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(Graphic[] features)
Adds a collection of graphics to the list of graphics NOTE: StopGraphic may also be used here
void addFeatures(StopGraphic[] features)
Adds a a collection of StopGraphic to the list of graphics
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 graphics 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(StopGraphic[] features)
Overwrites the current list of graphics
void setFeatures(Graphic[] features)
Overwrites the current list of graphics NOTE: StopGraphic may also be used here
void setHasZ(boolean hasZ)
Sets whether or not these graphics 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.ags.na.NAFeatures

Public Constructors

public NAFeaturesAsFeature ()

Empty constructor

public NAFeaturesAsFeature (List<Graphic> features)

Constructor taking the list of graphics

Parameters
features 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 The list of graphics
hasZ true if graphics contain z values
doNotLocateOnRestrictedElements true if restricted elements should be ignored

public NAFeaturesAsFeature (String url)

Constructor taking a url for querying features

Parameters
url 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 The url for the FeatureLayer (query built into url)
hasZ true if graphics contain z values
doNotLocateOnRestrictedElements 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 The graphic to add

public void addFeature (StopGraphic feature)

Adds a StopGraphic to the list of graphics

Parameters
feature The StopGraphic 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 The collection of graphics to add

public void addFeatures (StopGraphic[] features)

Adds a a collection of StopGraphic to the list of graphics

Parameters
features The collection of StopGraphics to add

public void clearFeatures ()

Clears out the list of graphics

public boolean equals (Object obj)

public List<Graphic> getFeatures ()

Retrieves the list of graphics

Returns
  • List the list of graphics

public SpatialReference getSpatialReference ()

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

Returns
  • 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 the url for the querying a FeatureLayer (query built into url)

public int hashCode ()

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
  • the compressedRequest true to send in compressed format

public Boolean isDoNotLocateOnRestrictedElements ()

Gets whether or not to consider restricted elements when locating

Returns
  • boolean true if restricted elements should be considered

public boolean isHasZ ()

Gets whether or not these graphics contain z values

Returns
  • boolean true if graphics 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 true to send in compressed format

public void setDoNotLocateOnRestrictedElements (Boolean doNotLocateOnRestrictedElements)

Sets whether or not to consider restricted elements when locating

Parameters
doNotLocateOnRestrictedElements true if restricted elements should be considered

public void setFeatures (StopGraphic[] features)

Overwrites the current list of graphics

Parameters
features The StopGraphics that should override the current graphics

public void setFeatures (Graphic[] features)

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

Parameters
features The graphics that should override the current graphics

public void setHasZ (boolean hasZ)

Sets whether or not these graphics contain z values

Parameters
hasZ true if graphics contain z values

public void setSpatialReference (SpatialReference spatialRef)

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

Parameters
spatialRef 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 the url for the querying a FeatureLayer (query built into url)

public String toJson ()

Translates all fields into a JSON object representation

Returns
  • String the JSON representation
Throws
Exception