com.esri.arcgis.networkanalyst
Interface INAContextEdit

All Superinterfaces:
Serializable
All Known Implementing Classes:
NAContext

public interface INAContextEdit
extends Serializable

Provides access to the editable properties of a network analysis context.

Remarks

The INAContextEdit interface is used to set up some of the internal references to objects and to manage edit operations within the NAClasses.

You must call Bind after calling CreateContext on NASolver. Solvers must call Initialize when they create the NAContext. If updating NALocationObjects outside of ArcMap, the methods to perform edits within an edit operation can be used. However, if edits are being done within ArcMap, it is recommended that the edit operation methods on the NAWindow's INAWindow be used instead so ArcMap's undo/redo stack remains in sync.

The Result and Solver properties should only be set from within a custom solver.

Product Availability

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


Method Summary
 void abortEditOperation()
          Cancels an edit operation in progress.
 void bind(INetworkDataset pNetworkDataset, IGPMessages pGPMessages)
          Prepare the context for analysis based upon the current network dataset schema.
 void clearInputNAObjects()
          Empty NAClasses that are defined as input or input/output.
 void clearOutputNAObjects()
          Empty NAClasses that are defined as output only.
 void contextChanged()
          Message all of the network analysis agents that the analysis context has changed.
 INAClass createAnalysisClass(INAClassDefinition classDef)
          Create a new analysis class based upon the given class definition.
 boolean hasRedos()
          Indicates if any redo operations are available.
 boolean hasUndos()
          Indicates if any undo operations are available.
 void initialize(String name, IDENetworkDataset network)
          Prepare the context for analysis.
 boolean isBeingEdited()
          Indicates if the class is currently being edited.
 void redoEditOperation()
          Repeats the last edit operation.
 void resultChanged()
          Message all of the network analysis agents that the analysis results have changed.
 void setLocatorByRef(INALocator rhs1)
          The locator used for finding network locations.
 void setResultByRef(INAResult rhs1)
          The result of the analysis.
 void setSolverByRef(INASolver rhs1)
          The function used for the analysis.
 void startEditing(boolean withUndoRedo)
          Starts an edit session.
 void startEditOperation()
          Starts an edit operation.
 void stopEditing(boolean saveEdits)
          Stops an edit session.
 void stopEditOperation()
          Stops an edit operation.
 void undoEditOperation()
          Cancels the last edit operation and returns to the state before it was started.
 

Method Detail

setResultByRef

void setResultByRef(INAResult rhs1)
                    throws IOException,
                           AutomationException
The result of the analysis.

Remarks

The Result property is set by the solver after performing a network analysis.

This property should only be set by a custom solver after performing network analysis.

Product Availability

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

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

setSolverByRef

void setSolverByRef(INASolver rhs1)
                    throws IOException,
                           AutomationException
The function used for the analysis.

Remarks

The Solver property returns a reference back to the NASolver object that created the NAContext.

This property should only be set by a custom solver during the creation of the NAContext.

Product Availability

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

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

setLocatorByRef

void setLocatorByRef(INALocator rhs1)
                     throws IOException,
                            AutomationException
The locator used for finding network locations.

Remarks

Use the Locator property to change the default NALocator for the NAContext.

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.

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

initialize

void initialize(String name,
                IDENetworkDataset network)
                throws IOException,
                       AutomationException
Prepare the context for analysis.

Remarks

Initialize should be called immediately after the NAContext is first created to create and initialize its internal member variables, including the workspace for the NAClasses, the NamedSet of NAAgents, the NamedSet of NAClasses, and the default NALocator .

Note: This method should only be called by a custom solver during the creation of the NAContext.

Note: If Initialize is called on a NAContext that has already been initialized, an exception will be thrown.

Product Availability

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

Parameters:
name - The name (in)
network - A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

bind

void bind(INetworkDataset pNetworkDataset,
          IGPMessages pGPMessages)
          throws IOException,
                 AutomationException
Prepare the context for analysis based upon the current network dataset schema.

Remarks

Bind attaches the NAContext to the input NetworkDataset. This ensures the NAContext is properly initialized based on the network dataset specified.

You must call Bind after calling CreateContext on NASolver.

Product Availability

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

Parameters:
pNetworkDataset - A reference to a com.esri.arcgis.geodatabase.INetworkDataset (in)
pGPMessages - A reference to a com.esri.arcgis.geodatabase.IGPMessages (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearInputNAObjects

void clearInputNAObjects()
                         throws IOException,
                                AutomationException
Empty NAClasses that are defined as input or input/output.

Remarks

ClearInputNAObjects is a helper method to quickly go through the NAClasses that are used for input and to remove all of the rows from them.

Product Availability

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

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

clearOutputNAObjects

void clearOutputNAObjects()
                          throws IOException,
                                 AutomationException
Empty NAClasses that are defined as output only.

Remarks

ClearOutputNAObjects is a helper method to quickly go through the NAClasses that are used for output and to remove all of the rows from them.

Product Availability

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

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

contextChanged

void contextChanged()
                    throws IOException,
                           AutomationException
Message all of the network analysis agents that the analysis context has changed.

Remarks

ContextChanged should be called if you have changed a property of the NAContext or have added NALocationObjects and want to fire the event OnNAContextUpdated on the INAContextEvents interface.

Product Availability

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

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

resultChanged

void resultChanged()
                   throws IOException,
                          AutomationException
Message all of the network analysis agents that the analysis results have changed.

Remarks

ResultChanged should be called if a custom solver has performed a network analysis, has updated the NATraversalResult, and wants to fire the event OnNAResultUpdated on the INAContextEvents interface.

Product Availability

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

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

createAnalysisClass

INAClass createAnalysisClass(INAClassDefinition classDef)
                             throws IOException,
                                    AutomationException
Create a new analysis class based upon the given class definition.

Remarks

CreateAnalysisClass creates a new NAClass based on the INAClassDefinition that will be managed by the NAContext.

Product Availability

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

Parameters:
classDef - A reference to a com.esri.arcgis.networkanalyst.INAClassDefinition (in)
Returns:
A reference to a com.esri.arcgis.networkanalyst.INAClass
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startEditing

void startEditing(boolean withUndoRedo)
                  throws IOException,
                         AutomationException
Starts an edit session.

Remarks

StartEditing starts an edit session on the NAContext's NAClasses. The withUndoRedo parameter can be used to suppress undo/redo logging if the workspace supports such suppression.

Product Availability

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

Parameters:
withUndoRedo - The withUndoRedo (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

stopEditing

void stopEditing(boolean saveEdits)
                 throws IOException,
                        AutomationException
Stops an edit session.

Remarks

StopEditing stops the edit session on the NAContext's NAClasses. The saveEdits parameter controls if edits are saved or discarded.

Product Availability

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

Parameters:
saveEdits - The saveEdits (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startEditOperation

void startEditOperation()
                        throws IOException,
                               AutomationException
Starts an edit operation.

Remarks

StartEditOperation starts an edit operation on the NAContext's NAClasses. This can be used to enable undo and redo operations on changes to the NAClasses.

All related changes to objects in the database within an edit session should be grouped into edit operations. An edit operation is begun using the StartEditOperation method. An edit operation may be thought of as a short transaction nested within the long transaction corresponding to the edit session.

When using StartEditOperation, proper handling of errors, including the use of AbortEditOperation, is necessary.

Product Availability

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

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

stopEditOperation

void stopEditOperation()
                       throws IOException,
                              AutomationException
Stops an edit operation.

Remarks

StopEditOperation stops the edit operation on the NAContext's NAClasses.

Applications are responsible for calling StopEditOperation to mark the end of a successfully completed edit operation. Completed edit operations can be thought of as being pushed onto an undo stack.

When using StopEditOperation, proper handling of errors, including the use of AbortEditOperation, is neccessary.

Product Availability

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

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

abortEditOperation

void abortEditOperation()
                        throws IOException,
                               AutomationException
Cancels an edit operation in progress.

Remarks

AbortEditOperation aborts the edit operation on the NAContext's NAClasses.

Applications are responsible for calling the AbortEditOperation method to abort an edit operation if errors are detected within the methods executed for an edit operation.

Product Availability

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

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

undoEditOperation

void undoEditOperation()
                       throws IOException,
                              AutomationException
Cancels the last edit operation and returns to the state before it was started.

Remarks

UndoEditOperation undoes the edit operation on the NAContext's NAClasses.

Product Availability

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

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

redoEditOperation

void redoEditOperation()
                       throws IOException,
                              AutomationException
Repeats the last edit operation.

Remarks

RedoEditOperation redoes the edit operation on the NAContext's NAClasses.

Product Availability

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

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

hasRedos

boolean hasRedos()
                 throws IOException,
                        AutomationException
Indicates if any redo operations are available.

Remarks

HasRedos specifies if there are operations that can be re-executed on the NAContext's NAClasses.

Product Availability

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

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

hasUndos

boolean hasUndos()
                 throws IOException,
                        AutomationException
Indicates if any undo operations are available.

Remarks

HasUndos specifies if there are operations that can be undone on the NAContext's NAClasses.

Product Availability

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

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

isBeingEdited

boolean isBeingEdited()
                      throws IOException,
                             AutomationException
Indicates if the class is currently being edited.

Remarks

IsBeingEdited specifies if there is a current active edit session on the NAContext's NAClasses.

Product Availability

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

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