com.esri.arcgis.networkanalyst
Class NAStreetDirectionsAgent

java.lang.Object
  extended by com.esri.arcgis.networkanalyst.NAStreetDirectionsAgent
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, INAAgent, INAStreetDirectionsAgent, INAStreetDirectionsAgent2, INAStreetDirectionsAgent3, IPersist, IPersistStream, ISupportErrorInfo, Externalizable, Serializable

public class NAStreetDirectionsAgent
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, INAAgent, INAStreetDirectionsAgent, INAStreetDirectionsAgent2, INAStreetDirectionsAgent3, IPersist, IPersistStream, ISupportErrorInfo, Externalizable

Generates driving directions for network analysis results.

Remarks

The NAStreetDirectionsAgent object generates driving directions on a route or multiple routes.

You get the NAStreetDirectionsAgent from the NAContext's list of agents using the name "StreetDirectionsAgent". For example:

Set pStreetAgent = NAContext.Agents.ItemByName("StreetDirectionsAgent")

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Constructor Summary
NAStreetDirectionsAgent()
          Constructs a NAStreetDirectionsAgent using ArcGIS Engine.
NAStreetDirectionsAgent(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
NAStreetDirectionsAgent theNAStreetDirectionsAgent = (NAStreetDirectionsAgent) obj;
 
Method Summary
 boolean applies(IDENetworkDataset network, INAContextHelper contextHelper)
          Indicates if the agent is appropriate to use with the given network dataset.
 boolean equals(Object o)
          Compare this object with another
 void execute(ISet set, ITrackCancel trackCancel)
          Constructs the directions.
 IStringArray getAvailableStyleNames()
          The collection of style names supported by the agent.
 void getClassID(GUID[] pClassID)
          getClassID
static String getClsid()
          getClsid.
 INAStreetDirectionsContainer getDirectionsContainer()
          The container for the directions.
 String getLanguage()
          Language to use when generating directions.
 int getLengthUnits()
          The length units.
 String getName()
          The name of the agent.
 ISpatialReference getOutputSpatialReference()
          Output spatial reference to use for geometries returned by the directions objects.
 int getOutputType()
          Output type to use when generating directions.
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          getSizeMax
 String getStyleName()
          Style name to use when generating directions.
 IStringArray getSupportedLanguages()
          The collection of languages supported by the agent.
 String getTimeAttributeName()
          The network attribute for time calculation.
 int hashCode()
          the hashcode for this object
 void initialize(IDENetworkDataset network, INAContextHelper contextHelper)
          Get the agent ready for action.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 boolean isAutoShowDirections()
          Indicates if directions are automatically updated and shown when a route changes.
 void isDirty()
          isDirty
 boolean isDisplayTime()
          Indicates if time is displayed in directions.
 void load(IStream pstm)
          load
 void onContextUpdated()
          Called when the context is updated.
 void onResultUpdated()
          Called when a result is updated.
 void readExternal(ObjectInput in)
           
 void save(IStream pstm, int fClearDirty)
          save
 void setAutoShowDirections(boolean show)
          Indicates if directions are automatically updated and shown when a route changes.
 void setDisplayTime(boolean display)
          Indicates if time is displayed in directions.
 void setLanguage(String strLanguage)
          Language to use when generating directions.
 void setLengthUnits(int units)
          The length units.
 void setOutputSpatialReferenceByRef(ISpatialReference ppSpatialReference)
          Output spatial reference to use for geometries returned by the directions objects.
 void setOutputType(int pOutputType)
          Output type to use when generating directions.
 void setStyleName(String pStyleName)
          Style name to use when generating directions.
 void setTimeAttributeName(String name)
          The network attribute for time calculation.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

NAStreetDirectionsAgent

public NAStreetDirectionsAgent()
                        throws IOException,
                               UnknownHostException
Constructs a NAStreetDirectionsAgent using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

NAStreetDirectionsAgent

public NAStreetDirectionsAgent(Object obj)
                        throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
NAStreetDirectionsAgent theNAStreetDirectionsAgent = (NAStreetDirectionsAgent) obj;

Construct a NAStreetDirectionsAgent using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to NAStreetDirectionsAgent.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getName

public String getName()
               throws IOException,
                      AutomationException
The name of the agent.

Remarks

Returns the name of the agent. This property is implemented within the agent; there is no need to set this property.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getName in interface INAAgent
Returns:
The agentName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

applies

public boolean applies(IDENetworkDataset network,
                       INAContextHelper contextHelper)
                throws IOException,
                       AutomationException
Indicates if the agent is appropriate to use with the given network dataset.

Remarks

The method Applies indicates if the NAAgent should be attached to the NAContext referenced by the input INAContextHelper.


Applies returns true if the agent is applicable and has not already been attached to the NAContext. For example, a NAStreetDirectionsAgent will only apply to solvers that support driving directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
applies in interface INAAgent
Parameters:
network - A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
contextHelper - A reference to a com.esri.arcgis.networkanalyst.INAContextHelper (in)
Returns:
The agentApplies
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initialize

public void initialize(IDENetworkDataset network,
                       INAContextHelper contextHelper)
                throws IOException,
                       AutomationException
Get the agent ready for action.

Remarks

Initialize is called when the NAContext::Bind is called and the NAContext is getting into a consistent state.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
initialize in interface INAAgent
Parameters:
network - A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
contextHelper - A reference to a com.esri.arcgis.networkanalyst.INAContextHelper (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onResultUpdated

public void onResultUpdated()
                     throws IOException,
                            AutomationException
Called when a result is updated.

Remarks

OnResultUpdated is called when the NAContext::Result object has been updated. For example, this would be called after INASolver::Solve.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
onResultUpdated in interface INAAgent
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onContextUpdated

public void onContextUpdated()
                      throws IOException,
                             AutomationException
Called when the context is updated.

Remarks

OnContextUpdated is called when the NAContext object has been updated. For example, this would be called after a network location has been added or removed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
onContextUpdated in interface INAAgent
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLengthUnits

public int getLengthUnits()
                   throws IOException,
                          AutomationException
The length units.

Remarks

LengthUnits specifies the length units of the directions in esriNetworkAttributeUnits. The currently supported length units for this property are esriNAUMiles, esriNAUKilometers, esriNAUMeters, esriNAUYards, and esriNAUFeet.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getLengthUnits in interface INAStreetDirectionsAgent
Returns:
A com.esri.arcgis.geodatabase.esriNetworkAttributeUnits constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLengthUnits

public void setLengthUnits(int units)
                    throws IOException,
                           AutomationException
The length units.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setLengthUnits in interface INAStreetDirectionsAgent
Parameters:
units - A com.esri.arcgis.geodatabase.esriNetworkAttributeUnits constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isDisplayTime

public boolean isDisplayTime()
                      throws IOException,
                             AutomationException
Indicates if time is displayed in directions.

Remarks

DisplayTime indicates if the direction driving time should be displayed or not.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isDisplayTime in interface INAStreetDirectionsAgent
Returns:
The display
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDisplayTime

public void setDisplayTime(boolean display)
                    throws IOException,
                           AutomationException
Indicates if time is displayed in directions.

Remarks

DisplayTime indicates if the direction driving time should be displayed or not.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setDisplayTime in interface INAStreetDirectionsAgent
Parameters:
display - The display (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTimeAttributeName

public String getTimeAttributeName()
                            throws IOException,
                                   AutomationException
The network attribute for time calculation.

Remarks

TimeAttributeName specifies the name of the time cost attribute used by directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getTimeAttributeName in interface INAStreetDirectionsAgent
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTimeAttributeName

public void setTimeAttributeName(String name)
                          throws IOException,
                                 AutomationException
The network attribute for time calculation.

Remarks

TimeAttributeName specifies the name of the time cost attribute used by directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setTimeAttributeName in interface INAStreetDirectionsAgent
Parameters:
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isAutoShowDirections

public boolean isAutoShowDirections()
                             throws IOException,
                                    AutomationException
Indicates if directions are automatically updated and shown when a route changes.

Remarks

AutoShowDirections indicates if the NADirectionsWindow is shown automatically after a route is solved.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isAutoShowDirections in interface INAStreetDirectionsAgent
Returns:
The show
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAutoShowDirections

public void setAutoShowDirections(boolean show)
                           throws IOException,
                                  AutomationException
Indicates if directions are automatically updated and shown when a route changes.

Remarks

AutoShowDirections indicates if the NADirectionsWindow will be shown automatically after a route is solved or not.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setAutoShowDirections in interface INAStreetDirectionsAgent
Parameters:
show - The show (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDirectionsContainer

public INAStreetDirectionsContainer getDirectionsContainer()
                                                    throws IOException,
                                                           AutomationException
The container for the directions.

Remarks

DirectionsContainer provides access to the directions contents and a method to save the contents in a file in XML format.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDirectionsContainer in interface INAStreetDirectionsAgent
Returns:
A reference to a com.esri.arcgis.networkanalyst.INAStreetDirectionsContainer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

execute

public void execute(ISet set,
                    ITrackCancel trackCancel)
             throws IOException,
                    AutomationException
Constructs the directions.

Remarks

Execute is a method to compute the driving directions. This method takes a set containing the route features that you want to generate directions for. If null is passed in, it will generate directions for all routes. If you want to generate directions for a subset of the routes, create a new set object and add route features from the corresponding Routes or CFRoutes network analysis class.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
execute in interface INAStreetDirectionsAgent
Parameters:
set - A reference to a com.esri.arcgis.system.ISet (in)
trackCancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLanguage

public String getLanguage()
                   throws IOException,
                          AutomationException
Language to use when generating directions.

Remarks

Specifies the Language you want to see the directions in.

This requires that you know which languages are supported by your directions configuration files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getLanguage in interface INAStreetDirectionsAgent2
Returns:
The strLanguage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLanguage

public void setLanguage(String strLanguage)
                 throws IOException,
                        AutomationException
Language to use when generating directions.

Remarks

Specifies the Language you want to see the directions in.

This requires that you know which languages are supported by your directions configuration files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setLanguage in interface INAStreetDirectionsAgent2
Parameters:
strLanguage - The strLanguage (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getOutputSpatialReference

public ISpatialReference getOutputSpatialReference()
                                            throws IOException,
                                                   AutomationException
Output spatial reference to use for geometries returned by the directions objects.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getOutputSpatialReference in interface INAStreetDirectionsAgent3
Returns:
A reference to a com.esri.arcgis.geometry.ISpatialReference
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setOutputSpatialReferenceByRef

public void setOutputSpatialReferenceByRef(ISpatialReference ppSpatialReference)
                                    throws IOException,
                                           AutomationException
Output spatial reference to use for geometries returned by the directions objects.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setOutputSpatialReferenceByRef in interface INAStreetDirectionsAgent3
Parameters:
ppSpatialReference - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSupportedLanguages

public IStringArray getSupportedLanguages()
                                   throws IOException,
                                          AutomationException
The collection of languages supported by the agent.

Remarks

Returns a string array of the supported languages for which this directions agent has been localized. The configuration files associated with street directions can be found in <install directory>\NetworkAnalyst\Directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getSupportedLanguages in interface INAStreetDirectionsAgent3
Returns:
A reference to a com.esri.arcgis.system.IStringArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAvailableStyleNames

public IStringArray getAvailableStyleNames()
                                    throws IOException,
                                           AutomationException
The collection of style names supported by the agent.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getAvailableStyleNames in interface INAStreetDirectionsAgent3
Returns:
A reference to a com.esri.arcgis.system.IStringArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getStyleName

public String getStyleName()
                    throws IOException,
                           AutomationException
Style name to use when generating directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getStyleName in interface INAStreetDirectionsAgent3
Returns:
The pStyleName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setStyleName

public void setStyleName(String pStyleName)
                  throws IOException,
                         AutomationException
Style name to use when generating directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setStyleName in interface INAStreetDirectionsAgent3
Parameters:
pStyleName - The pStyleName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getOutputType

public int getOutputType()
                  throws IOException,
                         AutomationException
Output type to use when generating directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getOutputType in interface INAStreetDirectionsAgent3
Returns:
A com.esri.arcgis.networkanalyst.esriDirectionsOutputType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setOutputType

public void setOutputType(int pOutputType)
                   throws IOException,
                          AutomationException
Output type to use when generating directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setOutputType in interface INAStreetDirectionsAgent3
Parameters:
pOutputType - A com.esri.arcgis.networkanalyst.esriDirectionsOutputType constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClassID

public void getClassID(GUID[] pClassID)
                throws IOException,
                       AutomationException
getClassID

Description

IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getClassID in interface IPersist
Parameters:
pClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isDirty

public void isDirty()
             throws IOException,
                    AutomationException
isDirty

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isDirty in interface IPersistStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

load

public void load(IStream pstm)
          throws IOException,
                 AutomationException
load

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
load in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

save

public void save(IStream pstm,
                 int fClearDirty)
          throws IOException,
                 AutomationException
save

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
save in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
fClearDirty - The fClearDirty (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSizeMax

public void getSizeMax(_ULARGE_INTEGER[] pcbSize)
                throws IOException,
                       AutomationException
getSizeMax

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSizeMax in interface IPersistStream
Parameters:
pcbSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException