com.esri.arcgis.networkanalyst
Class NAClassLoader

java.lang.Object
  extended by com.esri.arcgis.networkanalyst.NAClassLoader
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, INAClassLoader, INAClassLoader2, ISupportErrorInfo, Serializable

public class NAClassLoader
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, INAClassLoader, INAClassLoader2, ISupportErrorInfo

Loads a network class based on its field maps.

Remarks

An NAClass is like a feature class with "rows" of network analysis inputs and outputs. The NAClassLoader uses a specified field mapping (INAClassFieldMap) and a network locator (INALocator) to populate an NAClass.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
NAClassLoader()
          Constructs a NAClassLoader using ArcGIS Engine.
NAClassLoader(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
NAClassLoader theNAClassLoader = (NAClassLoader) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 ILocator getAddressLocator()
          The address locator to be used.
static String getClsid()
          getClsid.
 INAClassFieldMap getFieldMap()
          The field mapping definition.
 INALocator getLocator()
          The locator to be used.
 INAClass getNAClass()
          The network analysis class.
 double getSnapOffsetDistance()
          The snap offset distance from the network.
 int getSnapOffsetUnits()
          The snap offset units.
 int hashCode()
          the hashcode for this object
 void initialize(INAContext context, String nAClassName, ICursor cursor)
          Quickly initializes the class loader to be able to load information from a cursor into a given NAClass.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 boolean isSnapToNetwork()
          Indicates if the geometry should be snapped to the network.
 void load(ICursor cursor, ITrackCancel trackCancel, int[] rowsInCursor, int[] rowsLocated)
          Populate the network analysis class.
 void setAddressLocatorByRef(ILocator addressLocator)
          The address locator to be used.
 void setFieldMapByRef(INAClassFieldMap fieldMapping)
          The field mapping definition.
 void setLocatorByRef(INALocator loaderLocator)
          The locator to be used.
 void setNAClassByRef(INAClass classToLoadInto)
          The network analysis class.
 void setSnapOffsetDistance(double distance)
          The snap offset distance from the network.
 void setSnapOffsetUnits(int units)
          The snap offset units.
 void setSnapToNetwork(boolean enabled)
          Indicates if the geometry should be snapped to the network.
 
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

NAClassLoader

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

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

NAClassLoader

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

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

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

setNAClassByRef

public void setNAClassByRef(INAClass classToLoadInto)
                     throws IOException,
                            AutomationException
The network analysis class.

Remarks

The NAClass property specifies the NAClass feature class holding the network locations that will be populated when INAClassLoader::Load is called.

Product Availability

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

Specified by:
setNAClassByRef in interface INAClassLoader
Parameters:
classToLoadInto - A reference to a com.esri.arcgis.networkanalyst.INAClass (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNAClass

public INAClass getNAClass()
                    throws IOException,
                           AutomationException
The network analysis class.

Remarks

The NAClass property specifies the NAClass feature class holding the network locations that will be populated when INAClassLoader::Load is called.

Product Availability

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

Specified by:
getNAClass in interface INAClassLoader
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.

setFieldMapByRef

public void setFieldMapByRef(INAClassFieldMap fieldMapping)
                      throws IOException,
                             AutomationException
The field mapping definition.

Remarks

FieldMap specifies the NAClassFieldMap that dictates what the values for the newly created NALocationFeatures will be. If there is a mapped field, the mapped field value will be used. If there is no mapped field or the mapped field value is NULL, the default value will be used.

Product Availability

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

Specified by:
setFieldMapByRef in interface INAClassLoader
Parameters:
fieldMapping - A reference to a com.esri.arcgis.networkanalyst.INAClassFieldMap (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFieldMap

public INAClassFieldMap getFieldMap()
                             throws IOException,
                                    AutomationException
The field mapping definition.

Remarks

FieldMap specifies the NAClassFieldMap that dictates what the values for the newly created NALocationFeatures will be. If there is a mapped field, the mapped field value will be used. If there is no mapped field or the mapped field value is NULL, the default value will be used.

Product Availability

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

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

setLocatorByRef

public void setLocatorByRef(INALocator loaderLocator)
                     throws IOException,
                            AutomationException
The locator to be used.

Remarks

The Locator property specifies how network locations will be found.

Product Availability

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

Specified by:
setLocatorByRef in interface INAClassLoader
Parameters:
loaderLocator - 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.

getLocator

public INALocator getLocator()
                      throws IOException,
                             AutomationException
The locator to be used.

Remarks

The Locator property specifies how network locations will be found.

Product Availability

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

Specified by:
getLocator in interface INAClassLoader
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.

load

public void load(ICursor cursor,
                 ITrackCancel trackCancel,
                 int[] rowsInCursor,
                 int[] rowsLocated)
          throws IOException,
                 AutomationException
Populate the network analysis class.

Remarks

Load iterates through the input cursor and populates the NAClass with NALocationFeatures with field values based on the FieldMap and Locator. It returns as output parameters the number of features in the cursor and the number of network locations that could be located.

If you know the number of rows in the input cursor and are passing a TrackCancel object that has a reference to an object that implements IStepProgressor, you should set the rowsInCursor parameter to the number of rows in the cursor. This will allow for feedback showing how many rows have been loaded out of the total number to load. For example it might say "Loading into "Stops" (120 of 230)". If you do not know how many rows are in the cursor, you should initialize the rowsInCursor variable to 0 prior to calling Load.

This method will return the error E_ABORT if the ITrackCancel object passed in to Load causes the load to cancel.

Product Availability

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

Specified by:
load in interface INAClassLoader
Parameters:
cursor - A reference to a com.esri.arcgis.geodatabase.ICursor (in)
trackCancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
rowsInCursor - The rowsInCursor (in/out: use single element array)
rowsLocated - The rowsLocated (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initialize

public void initialize(INAContext context,
                       String nAClassName,
                       ICursor cursor)
                throws IOException,
                       AutomationException
Quickly initializes the class loader to be able to load information from a cursor into a given NAClass.

Remarks

The INAClassLoader2::Initialize method sets the Locator, NAClass, and FieldMap properties otherwise set via methods on the INAClassLoader interface.

Product Availability

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

Specified by:
initialize in interface INAClassLoader2
Parameters:
context - A reference to a com.esri.arcgis.networkanalyst.INAContext (in)
nAClassName - The nAClassName (in)
cursor - A reference to a com.esri.arcgis.geodatabase.ICursor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAddressLocatorByRef

public void setAddressLocatorByRef(ILocator addressLocator)
                            throws IOException,
                                   AutomationException
The address locator to be used.

Remarks

The AddressLocator property specifies the ILocator address locator used to determine the name of the network location based on reverse geocoding of the network location's geometry.

Product Availability

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

Specified by:
setAddressLocatorByRef in interface INAClassLoader2
Parameters:
addressLocator - A reference to a com.esri.arcgis.geodatabase.ILocator (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAddressLocator

public ILocator getAddressLocator()
                           throws IOException,
                                  AutomationException
The address locator to be used.

Remarks

The AddressLocator property specifies the ILocator address locator used to determine the name of the network location based on reverse geocoding of the network location's geometry.

Product Availability

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

Specified by:
getAddressLocator in interface INAClassLoader2
Returns:
A reference to a com.esri.arcgis.geodatabase.ILocator
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapToNetwork

public void setSnapToNetwork(boolean enabled)
                      throws IOException,
                             AutomationException
Indicates if the geometry should be snapped to the network.

Remarks

SnapToNetwork specifies if the network location's geometry should be a snapped to where it lies on the network dataset during load.

Specify the SnapOffsetDistance and SnapOffsetUnits if you want the network location offset a fixed difference from the true snap location. This is useful if you care about the side of the road the network location is on.

Product Availability

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

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

isSnapToNetwork

public boolean isSnapToNetwork()
                        throws IOException,
                               AutomationException
Indicates if the geometry should be snapped to the network.

Remarks

SnapToNetwork specifies if the network location's geometry should be snapped to where it lies on the network dataset during load.

Specify the SnapOffsetDistance and SnapOffsetUnits if you want the network location offset a fixed difference from the true snap location. This is useful if you care about the side of the road the network location is on.

Product Availability

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

Specified by:
isSnapToNetwork in interface INAClassLoader2
Returns:
The enabled
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapOffsetDistance

public void setSnapOffsetDistance(double distance)
                           throws IOException,
                                  AutomationException
The snap offset distance from the network.

Remarks

Specify the SnapOffsetDistance and SnapOffsetUnits if you want the network location offset a fixed difference from the true snap location. This is useful if you care about the side of the road the network location is on.

This is only applicable if SnapToNetwork is true.

Product Availability

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

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

getSnapOffsetDistance

public double getSnapOffsetDistance()
                             throws IOException,
                                    AutomationException
The snap offset distance from the network.

Remarks

Specify the SnapOffsetDistance and SnapOffsetUnits if you want the network location offset a fixed difference from the true snap location. This is useful if you care about the side of the road the network location is on.

This is only applicable if SnapToNetwork is true.

Product Availability

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

Specified by:
getSnapOffsetDistance in interface INAClassLoader2
Returns:
The distance
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapOffsetUnits

public void setSnapOffsetUnits(int units)
                        throws IOException,
                               AutomationException
The snap offset units.

Remarks

Specify the SnapOffsetDistance and SnapOffsetUnits if you want the network location offset a fixed difference from the true snap location. This is useful if you care about the side of the road the network location is on.

This is only applicable if SnapToNetwork is true.

Product Availability

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

Specified by:
setSnapOffsetUnits in interface INAClassLoader2
Parameters:
units - A com.esri.arcgis.system.esriUnits constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapOffsetUnits

public int getSnapOffsetUnits()
                       throws IOException,
                              AutomationException
The snap offset units.

Remarks

Specify the SnapOffsetDistance and SnapOffsetUnits if you want the network location offset a fixed difference from the true snap location. This is useful if you care about the side of the road the network location is on.

This is only applicable if SnapToNetwork is true.

Product Availability

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

Specified by:
getSnapOffsetUnits in interface INAClassLoader2
Returns:
A com.esri.arcgis.system.esriUnits constant
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.