com.esri.arcgis.networkanalyst
Interface INAContext

All Superinterfaces:
Serializable
All Known Implementing Classes:
NAContext

public interface INAContext
extends Serializable

Provides access to the network analysis context.

Remarks

The INAContext interface can be used to obtain references to the constellation of objects used during network analysis. This includes references to the NetworkDataset, NASolver, NAClasses, NATraversalResult, NALocator, and any extra objects that implement INAAgent.

Product Availability

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


Method Summary
 INamedSet getAgents()
          The collection of agents associated with the analysis.
 INALocator getLocator()
          The locator used for finding network locations for class items.
 INamedSet getNAClasses()
          The collection of classes associated with the analysis.
 String getName()
          The name of the analysis.
 INetworkDataset getNetworkDataset()
          The associated network dataset.
 IName getNetworkDatasetName()
          The associated network dataset name.
 INAResult getResult()
          The result for the analysis.
 INASolver getSolver()
          The function used for the analysis.
 ISpatialReference getSpatialReference()
          The spatial reference of the analysis.
 

Method Detail

getName

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

Remarks

Name returns the name of the NAContext that was specified when the NAContext was created via INASolver.CreateContext.

Product Availability

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

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSpatialReference

ISpatialReference getSpatialReference()
                                      throws IOException,
                                             AutomationException
The spatial reference of the analysis.

Remarks

SpatialReference returns the spatial reference of the associated NetworkDataset.

Product Availability

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

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.

getSolver

INASolver getSolver()
                    throws IOException,
                           AutomationException
The function used for the analysis.

Remarks

Solver returns an object that implements INASolver. This is generally the solver that created the NAContext.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.networkanalyst.INASolver
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAgents

INamedSet getAgents()
                    throws IOException,
                           AutomationException
The collection of agents associated with the analysis.

Remarks

Agents returns any custom agents that are attached to the NAContext. Agents are objects that implement INAAgent and perform additional behavior when the NAContext is updated and when the NATraversalResult is updated.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.networkanalyst.INamedSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getResult

INAResult getResult()
                    throws IOException,
                           AutomationException
The result for the analysis.

Remarks

Result returns the NATraversalResult, which is the results of the network analysis.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.networkanalyst.INAResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNAClasses

INamedSet getNAClasses()
                       throws IOException,
                              AutomationException
The collection of classes associated with the analysis.

Remarks

NAClasses returns a NamedSet of the NAClasses (e.g. Stops, Barriers, Routes) that are contained within the NAContext.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.networkanalyst.INamedSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLocator

INALocator getLocator()
                      throws IOException,
                             AutomationException
The locator used for finding network locations for class items.

Remarks

Locator returns the default NALocator for the NAClass.

The locator is used by the network analyst loading tools when it tries to locate NALocationObjects. You can set the Locator property on the INAContextEdit interface to change the default locator. You can also override the locator used if you call NAClassLoader programmatically.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.networkanalyst.INALocator
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNetworkDataset

INetworkDataset getNetworkDataset()
                                  throws IOException,
                                         AutomationException
The associated network dataset.

Remarks

NetworkDataset returns the NetworkDataset that the NAContext is referencing.

The NetworkDataset is only available after the NAContext has been bound to a NetworkDataset using INAContextEdit::Bind.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.geodatabase.INetworkDataset
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNetworkDatasetName

IName getNetworkDatasetName()
                            throws IOException,
                                   AutomationException
The associated network dataset name.

Remarks

NetworkDatasetName returns a Name object to the NetworkDataset that the NAContext is referencing.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.system.IName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.