com.esri.core.tasks.ags.na
Class NAFeaturesAsFeature

java.lang.Object
  extended by com.esri.core.tasks.ags.na.NAFeaturesAsFeature
All Implemented Interfaces:
NAFeatures

public class NAFeaturesAsFeature
extends Object
implements NAFeatures

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

Since:
10.1.1

Constructor Summary
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
 
Method Summary
 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(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 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NAFeaturesAsFeature

public NAFeaturesAsFeature()
Empty constructor

Since:
10.1.1

NAFeaturesAsFeature

public NAFeaturesAsFeature(List<Graphic> features)
Constructor taking the list of graphics

Parameters:
features - The list of graphics
Since:
10.1.1

NAFeaturesAsFeature

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
Since:
10.1.1

NAFeaturesAsFeature

public NAFeaturesAsFeature(String url)
Constructor taking a url for querying features

Parameters:
url - The url for the FeatureLayer (query built into url)
Since:
10.1.1

NAFeaturesAsFeature

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
Since:
10.1.1
Method Detail

addFeature

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
Since:
10.1.1

addFeature

public void addFeature(StopGraphic feature)
Adds a StopGraphic to the list of graphics

Parameters:
feature - The StopGraphic to add
Since:
10.1.1

addFeatures

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
Since:
10.1.1

addFeatures

public void addFeatures(StopGraphic[] features)
Adds a a collection of StopGraphic to the list of graphics

Parameters:
features - The collection of StopGraphics to add
Since:
10.1.1

getFeatures

public List<Graphic> getFeatures()
Retrieves the list of graphics

Returns:
List the list of graphics
Since:
10.1.1

setFeatures

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
Since:
10.1.1

setFeatures

public void setFeatures(StopGraphic[] features)
Overwrites the current list of graphics

Parameters:
features - The StopGraphics that should override the current graphics
Since:
10.1.1

clearFeatures

public void clearFeatures()
Clears out the list of graphics

Since:
10.1.1

getSpatialReference

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
Since:
10.1.1

setSpatialReference

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
Since:
10.1.1

getURL

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)
Since:
10.1.1

setURL

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)
Since:
10.1.1

isHasZ

public boolean isHasZ()
Gets whether or not these graphics contain z values

Returns:
boolean true if graphics contain z values
Since:
10.1.1

setHasZ

public void setHasZ(boolean hasZ)
Sets whether or not these graphics contain z values

Parameters:
hasZ - true if graphics contain z values
Since:
10.1.1

isDoNotLocateOnRestrictedElements

public Boolean isDoNotLocateOnRestrictedElements()
Gets whether or not to consider restricted elements when locating

Returns:
boolean true if restricted elements should be considered
Since:
10.1.1

setDoNotLocateOnRestrictedElements

public void setDoNotLocateOnRestrictedElements(Boolean doNotLocateOnRestrictedElements)
Sets whether or not to consider restricted elements when locating

Parameters:
doNotLocateOnRestrictedElements - true if restricted elements should be considered
Since:
10.1.1

isCompressedRequest

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
Since:
10.1.1

setCompressedRequest

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
Since:
10.1.1

toJson

public String toJson()
              throws Exception
Translates all fields into a JSON object representation

Specified by:
toJson in interface NAFeatures
Returns:
String the JSON representation
Throws:
Exception
Since:
10.1.1

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.