|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.networkanalyst.NAContext
public class NAContext
The analysis and problem definition container.
The NAContext is the center of the constellation of objects that are used during network analysis.
The NAContext is initially created by calling CreateContext on the INASolver interface of a network solver object. It is then generally accessed by getting the Context property from the INALayer interface on the NALayer object. The INAContext interface can be used to obtain references to the NetworkDataset, NASolver, NAClasses, NATraversalResult, NALocator, and any extra objects that implement INAAgent. The INAContextEdit interface is used to set up some of the internal references to objects and to manage edit operations within the NAClasses. The INAContextEvents interface is an outgoing interface that notifies clients when the NAContext is modified.
Constructor Summary | |
---|---|
NAContext()
Constructs a NAContext using ArcGIS Engine. |
|
NAContext(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. NAContext theNAContext = (NAContext) obj; |
Method Summary | |
---|---|
void |
abortEditOperation()
Cancels an edit operation in progress. |
void |
addINAContextEvents2Listener(INAContextEvents2 theListener)
addINAContextEvents2Listener. |
void |
addINAContextEventsListener(INAContextEvents theListener)
addINAContextEventsListener. |
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. |
void |
enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
enumConnectionPoints |
boolean |
equals(Object o)
Compare this object with another |
void |
findConnectionPoint(GUID riid,
IConnectionPoint[] ppCP)
findConnectionPoint |
INamedSet |
getAgents()
The collection of agents associated with the analysis. |
void |
getClassID(GUID[] pClassID)
getClassID |
static String |
getClsid()
getClsid. |
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. |
void |
getSizeMax(_ULARGE_INTEGER[] pcbSize)
getSizeMax |
INASolver |
getSolver()
The function used for the analysis. |
ISpatialReference |
getSpatialReference()
The spatial reference of the analysis. |
int |
hashCode()
the hashcode for this object |
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 |
isDirty()
isDirty |
void |
load(IStream pstm)
load |
void |
readExternal(ObjectInput in)
|
void |
redoEditOperation()
Repeats the last edit operation. |
void |
removeINAContextEvents2Listener(INAContextEvents2 theListener)
removeINAContextEvents2Listener. |
void |
removeINAContextEventsListener(INAContextEvents theListener)
removeINAContextEventsListener. |
void |
resultChanged()
Message all of the network analysis agents that the analysis results have changed. |
void |
save(IStream pstm,
int fClearDirty)
save |
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. |
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 |
---|
public NAContext() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic NAContext(Object obj) throws IOException
NAContext theNAContext = (NAContext) obj;
obj
to NAContext
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void addINAContextEventsListener(INAContextEvents theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.networkanalyst.INAContextEvents interface.
IOException
- If there are communications problems.public void removeINAContextEventsListener(INAContextEvents theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.networkanalyst.INAContextEvents interface.
IOException
- If there are communications problems.public void addINAContextEvents2Listener(INAContextEvents2 theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.networkanalyst.INAContextEvents2 interface.
IOException
- If there are communications problems.public void removeINAContextEvents2Listener(INAContextEvents2 theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.networkanalyst.INAContextEvents2 interface.
IOException
- If there are communications problems.public String getName() throws IOException, AutomationException
Name returns the name of the NAContext that was specified when the NAContext was created via INASolver.CreateContext.
getName
in interface INAContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ISpatialReference getSpatialReference() throws IOException, AutomationException
SpatialReference returns the spatial reference of the associated NetworkDataset.
getSpatialReference
in interface INAContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public INASolver getSolver() throws IOException, AutomationException
Solver returns an object that implements INASolver. This is generally the solver that created the NAContext.
getSolver
in interface INAContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public INamedSet getAgents() throws IOException, AutomationException
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.
getAgents
in interface INAContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public INAResult getResult() throws IOException, AutomationException
Result returns the NATraversalResult, which is the results of the network analysis.
getResult
in interface INAContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public INamedSet getNAClasses() throws IOException, AutomationException
NAClasses returns a NamedSet of the NAClasses (e.g. Stops, Barriers, Routes) that are contained within the NAContext.
getNAClasses
in interface INAContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public INALocator getLocator() throws IOException, AutomationException
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.
getLocator
in interface INAContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public INetworkDataset getNetworkDataset() throws IOException, AutomationException
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.
getNetworkDataset
in interface INAContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IName getNetworkDatasetName() throws IOException, AutomationException
NetworkDatasetName returns a Name object to the NetworkDataset that the NAContext is referencing.
getNetworkDatasetName
in interface INAContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setResultByRef(INAResult rhs1) throws IOException, AutomationException
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.
setResultByRef
in interface INAContextEdit
rhs1
- A reference to a com.esri.arcgis.networkanalyst.INAResult (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSolverByRef(INASolver rhs1) throws IOException, AutomationException
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.
setSolverByRef
in interface INAContextEdit
rhs1
- A reference to a com.esri.arcgis.networkanalyst.INASolver (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setLocatorByRef(INALocator rhs1) throws IOException, AutomationException
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.
setLocatorByRef
in interface INAContextEdit
rhs1
- A reference to a com.esri.arcgis.networkanalyst.INALocator (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void initialize(String name, IDENetworkDataset network) throws IOException, AutomationException
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.
initialize
in interface INAContextEdit
name
- The name (in)network
- A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void bind(INetworkDataset pNetworkDataset, IGPMessages pGPMessages) throws IOException, AutomationException
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.
bind
in interface INAContextEdit
pNetworkDataset
- A reference to a com.esri.arcgis.geodatabase.INetworkDataset (in)pGPMessages
- A reference to a com.esri.arcgis.geodatabase.IGPMessages (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void clearInputNAObjects() throws IOException, AutomationException
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.
clearInputNAObjects
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void clearOutputNAObjects() throws IOException, AutomationException
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.
clearOutputNAObjects
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void contextChanged() throws IOException, AutomationException
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.
contextChanged
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void resultChanged() throws IOException, AutomationException
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.
resultChanged
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public INAClass createAnalysisClass(INAClassDefinition classDef) throws IOException, AutomationException
CreateAnalysisClass creates a new NAClass based on the INAClassDefinition that will be managed by the NAContext.
createAnalysisClass
in interface INAContextEdit
classDef
- A reference to a com.esri.arcgis.networkanalyst.INAClassDefinition (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void startEditing(boolean withUndoRedo) throws IOException, AutomationException
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.
startEditing
in interface INAContextEdit
withUndoRedo
- The withUndoRedo (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void stopEditing(boolean saveEdits) throws IOException, AutomationException
StopEditing stops the edit session on the NAContext's NAClasses. The saveEdits parameter controls if edits are saved or discarded.
stopEditing
in interface INAContextEdit
saveEdits
- The saveEdits (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void startEditOperation() throws IOException, AutomationException
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.
startEditOperation
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void stopEditOperation() throws IOException, AutomationException
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.
stopEditOperation
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void abortEditOperation() throws IOException, AutomationException
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.
abortEditOperation
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void undoEditOperation() throws IOException, AutomationException
UndoEditOperation undoes the edit operation on the NAContext's NAClasses.
undoEditOperation
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void redoEditOperation() throws IOException, AutomationException
RedoEditOperation redoes the edit operation on the NAContext's NAClasses.
redoEditOperation
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean hasRedos() throws IOException, AutomationException
HasRedos specifies if there are operations that can be re-executed on the NAContext's NAClasses.
hasRedos
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean hasUndos() throws IOException, AutomationException
HasUndos specifies if there are operations that can be undone on the NAContext's NAClasses.
hasUndos
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isBeingEdited() throws IOException, AutomationException
IsBeingEdited specifies if there is a current active edit session on the NAContext's NAClasses.
isBeingEdited
in interface INAContextEdit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void isDirty() throws IOException, AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
isDirty
in interface IPersistStream
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void load(IStream pstm) throws IOException, AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
load
in interface IPersistStream
pstm
- A reference to a com.esri.arcgis.system.IStream (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void save(IStream pstm, int fClearDirty) throws IOException, AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
save
in interface IPersistStream
pstm
- A reference to a com.esri.arcgis.system.IStream (in)fClearDirty
- The fClearDirty (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getSizeMax(_ULARGE_INTEGER[] pcbSize) throws IOException, AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
getSizeMax
in interface IPersistStream
pcbSize
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getClassID(GUID[] pClassID) throws IOException, AutomationException
IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.
getClassID
in interface IPersist
pClassID
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void enumConnectionPoints(IEnumConnectionPoints[] ppEnum) throws IOException, AutomationException
IConnectionPointContainer is a Microsoft interface. Please refer to MSDN for information about this interface.
enumConnectionPoints
in interface IConnectionPointContainer
ppEnum
- A reference to a com.esri.arcgis.display.IEnumConnectionPoints (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void findConnectionPoint(GUID riid, IConnectionPoint[] ppCP) throws IOException, AutomationException
IConnectionPointContainer is a Microsoft interface. Please refer to MSDN for information about this interface.
findConnectionPoint
in interface IConnectionPointContainer
riid
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)ppCP
- A reference to a com.esri.arcgis.display.IConnectionPoint (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |