com.esri.arcgis.datasourcesfile
Class SMRouter

java.lang.Object
  extended by com.esri.arcgis.datasourcesfile.SMRouter
All Implemented Interfaces:
ISMRouter, ISMRouterSetup, ISMRouterSetup2, ISMRoutingMetaData, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class SMRouter
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ISMRouter, ISMRoutingMetaData, ISMRouterSetup, ISMRouterSetup2

The object for calculating routes and defining route settings.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
SMRouter(Object obj)
          Construct a SMRouter using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 void clearAllRestrictions()
          Removes all restrictions set on the route solver.
 void clearRestriction(int index)
          The method removes restriction at specified position from the list.
 boolean equals(Object o)
          Compare this object with another
 int getBacktrackPolicy()
          Controls the backtrack policy of the route solver.
 ISMNetBarriersCollection getBarriers()
          The network barriers collection of the router object.
 String getDescription()
          Descriptive text of the data product used in the routing service.
 int getDirectionsLengthUnits()
          The output length units used in driving directions.
 ISMFlagCreator getFlagCreator()
          The flag creator used by the router object.
 String getGeography()
          The name of the geographic region covered by the routing service.
 String getNetAttributeName()
          The network attribute that the router object currently uses.
 ISMNetAttributesCollection getNetAttributes()
          The network attributes collection of the router object.
 ISMNetAttributesAccess getNetAttributesAccess()
          The network attributes access of the router object.
 ISMRoadPreferences getPreferences()
          The road preferences used by the router object.
 String getProductName()
          Name of data product.
 String getProductVersion()
          Version of data product.
 String getProjectionString()
          The spatial reference of the source data used by the router object.
 ISMRestriction getRestriction(int index)
          Restriction at the position, specified by index.
 int getRestrictionCount()
          Number of restrictions in the list, which will be applied when finding route.
 ISMSpeedGroups getSpeedGroups()
          The speed groups used by the router object.
 String getTime()
          Date and time of data creation in ISO 8601 format.
 ISMTripPlanSettings getTripPlanSettings()
          The trip planning settings used by the router object.
 String getVendor()
          Name of data vendor.
 int hashCode()
          the hashcode for this object
 ISMStopsCollection reorderStops(ISMStopsCollection pISrcStops)
          Reorders the stops collection to minimize total driving time or distance.
 void setBacktrackPolicy(int pVal)
          Controls the backtrack policy of the route solver.
 void setDirectionsLengthUnits(int pVal)
          The output length units used in driving directions.
 void setNetAttributeName(String pVal)
          The network attribute that the router object currently uses.
 void setRestriction(ISMRestriction pRestriction)
          Sets a restriction to be used by the route solver.
 ISMDirections solve(ISMStopsCollection pIStops, ISMBreakTracker pITracker)
          Calculates the route using the current settings of the router object.
 
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

SMRouter

public SMRouter(Object obj)
         throws IOException
Construct a SMRouter using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to SMRouter.
Casting to this class from the return value of a method will not work, as this class represents an abstract class in ArcObjects.
*
SMRouter o = (SMRouter)obj; // will not work

SMRouter o = new SMRouter(obj); // Use this constructor instead
* @param obj an object returned from ArcGIS Engine or Server

Throws:
IOException - if there are interop problems SMRouter theSMRouter = (SMRouter) obj;
Method Detail

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

getBarriers

public ISMNetBarriersCollection getBarriers()
                                     throws IOException,
                                            AutomationException
The network barriers collection of the router object.

Description

Returns the network barriers collection interface of the router object.

Product Availability

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

Specified by:
getBarriers in interface ISMRouter
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMNetBarriersCollection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNetAttributes

public ISMNetAttributesCollection getNetAttributes()
                                            throws IOException,
                                                   AutomationException
The network attributes collection of the router object.

Description

Returns the network attributes collection interface of the router object.

Product Availability

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

Specified by:
getNetAttributes in interface ISMRouter
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMNetAttributesCollection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPreferences

public ISMRoadPreferences getPreferences()
                                  throws IOException,
                                         AutomationException
The road preferences used by the router object.

Description

Returns the road preferences interface of the router.

Product Availability

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

Specified by:
getPreferences in interface ISMRouter
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMRoadPreferences
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSpeedGroups

public ISMSpeedGroups getSpeedGroups()
                              throws IOException,
                                     AutomationException
The speed groups used by the router object.

Description

Returns the speed groups interface of the router object.

Product Availability

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

Specified by:
getSpeedGroups in interface ISMRouter
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMSpeedGroups
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTripPlanSettings

public ISMTripPlanSettings getTripPlanSettings()
                                        throws IOException,
                                               AutomationException
The trip planning settings used by the router object.

Description

Returns the trip planning settings interface of the router object.

Product Availability

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

Specified by:
getTripPlanSettings in interface ISMRouter
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMTripPlanSettings
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNetAttributeName

public String getNetAttributeName()
                           throws IOException,
                                  AutomationException
The network attribute that the router object currently uses.

Description

Returns the network attribute that the router object currently uses.

Remarks

Currently SMRouter supports two network attributes: "Time" and "Length". Assign the NetAttributeName value "Time" if you want to find the quickest route. Assign the NetAttributeName value "Length" if you want to find the shortest route.

Product Availability

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

Specified by:
getNetAttributeName in interface ISMRouter
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setNetAttributeName

public void setNetAttributeName(String pVal)
                         throws IOException,
                                AutomationException
The network attribute that the router object currently uses.

Description

Sets the network attribute that the router will use.

Remarks

Currently SMRouter supports two network attributes: "Time" and "Length". Assign the NetAttributeName value "Time" if you want to find quickest route. Assign the NetAttributeName value "Length" if you want to find shortest route.

Product Availability

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

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

reorderStops

public ISMStopsCollection reorderStops(ISMStopsCollection pISrcStops)
                                throws IOException,
                                       AutomationException
Reorders the stops collection to minimize total driving time or distance.

Description

Solves the TSP and repositions the stops collection, that is passed in, according to task solution.

Product Availability

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

Specified by:
reorderStops in interface ISMRouter
Parameters:
pISrcStops - A reference to a com.esri.arcgis.datasourcesfile.ISMStopsCollection (in)
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMStopsCollection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

solve

public ISMDirections solve(ISMStopsCollection pIStops,
                           ISMBreakTracker pITracker)
                    throws IOException,
                           AutomationException
Calculates the route using the current settings of the router object.

Description

Builds the route using all the current settings of the router object.

Remarks

The method returns the SMDirections object that contains the resulting path and driving directions texts. If no route is found then the method returns Nothing.


You need to pass an implementation of ISMBreakTracker interface as pBreakTracker parameter's value if you want to break route finding process according to some condition. If you don't need such functionality you can pass Nothing as the parameter's value.

Product Availability

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

Specified by:
solve in interface ISMRouter
Parameters:
pIStops - A reference to a com.esri.arcgis.datasourcesfile.ISMStopsCollection (in)
pITracker - A reference to a com.esri.arcgis.datasourcesfile.ISMBreakTracker (in)
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMDirections
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNetAttributesAccess

public ISMNetAttributesAccess getNetAttributesAccess()
                                              throws IOException,
                                                     AutomationException
The network attributes access of the router object.

Description

Returns the network attributes access interface of the router object.

Product Availability

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

Specified by:
getNetAttributesAccess in interface ISMRouter
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMNetAttributesAccess
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getProjectionString

public String getProjectionString()
                           throws IOException,
                                  AutomationException
The spatial reference of the source data used by the router object.

Description

Returns the projection string that corresponds to projection information of the routing data which the router object was created on.

Remarks

Projection string is returned in the same format as the CreateESRISpatialReferenceFromPRJ() method of the ISpatialReferenceFactory.

Product Availability

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

Specified by:
getProjectionString in interface ISMRouter
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFlagCreator

public ISMFlagCreator getFlagCreator()
                              throws IOException,
                                     AutomationException
The flag creator used by the router object.

Description

Returns the flag creator interface of the router object.

Product Availability

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

Specified by:
getFlagCreator in interface ISMRouter
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMFlagCreator
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getVendor

public String getVendor()
                 throws IOException,
                        AutomationException
Name of data vendor.

Product Availability

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

Specified by:
getVendor in interface ISMRoutingMetaData
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getProductName

public String getProductName()
                      throws IOException,
                             AutomationException
Name of data product.

Product Availability

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

Specified by:
getProductName in interface ISMRoutingMetaData
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getProductVersion

public String getProductVersion()
                         throws IOException,
                                AutomationException
Version of data product.

Product Availability

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

Specified by:
getProductVersion in interface ISMRoutingMetaData
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGeography

public String getGeography()
                    throws IOException,
                           AutomationException
The name of the geographic region covered by the routing service.

Product Availability

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

Specified by:
getGeography in interface ISMRoutingMetaData
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDescription

public String getDescription()
                      throws IOException,
                             AutomationException
Descriptive text of the data product used in the routing service.

Product Availability

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

Specified by:
getDescription in interface ISMRoutingMetaData
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTime

public String getTime()
               throws IOException,
                      AutomationException
Date and time of data creation in ISO 8601 format.

Product Availability

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

Specified by:
getTime in interface ISMRoutingMetaData
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setRestriction

public void setRestriction(ISMRestriction pRestriction)
                    throws IOException,
                           AutomationException
Sets a restriction to be used by the route solver.

Remarks

The SetRestriction method can be called multiple times to set multiple restrictions on the route solver.

Product Availability

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

Specified by:
setRestriction in interface ISMRouterSetup
Parameters:
pRestriction - A reference to a com.esri.arcgis.datasourcesfile.ISMRestriction (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearAllRestrictions

public void clearAllRestrictions()
                          throws IOException,
                                 AutomationException
Removes all restrictions set on the route solver.

Product Availability

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

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

getBacktrackPolicy

public int getBacktrackPolicy()
                       throws IOException,
                              AutomationException
Controls the backtrack policy of the route solver.

Remarks

The BacktrackPolicy affects how the solver handles U-turns. Please see the esriSMBacktrackPolicy enumeration for possible options.

Product Availability

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

Specified by:
getBacktrackPolicy in interface ISMRouterSetup
Returns:
A com.esri.arcgis.datasourcesfile.esriSMBacktrackPolicy constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setBacktrackPolicy

public void setBacktrackPolicy(int pVal)
                        throws IOException,
                               AutomationException
Controls the backtrack policy of the route solver.

Product Availability

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

Specified by:
setBacktrackPolicy in interface ISMRouterSetup
Parameters:
pVal - A com.esri.arcgis.datasourcesfile.esriSMBacktrackPolicy constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDirectionsLengthUnits

public int getDirectionsLengthUnits()
                             throws IOException,
                                    AutomationException
The output length units used in driving directions.

Product Availability

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

Specified by:
getDirectionsLengthUnits in interface ISMRouterSetup
Returns:
A com.esri.arcgis.datasourcesfile.esriSMDirectionsLengthUnits constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDirectionsLengthUnits

public void setDirectionsLengthUnits(int pVal)
                              throws IOException,
                                     AutomationException
The output length units used in driving directions.

Product Availability

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

Specified by:
setDirectionsLengthUnits in interface ISMRouterSetup
Parameters:
pVal - A com.esri.arcgis.datasourcesfile.esriSMDirectionsLengthUnits constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRestrictionCount

public int getRestrictionCount()
                        throws IOException,
                               AutomationException
Number of restrictions in the list, which will be applied when finding route.

Product Availability

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

Specified by:
getRestrictionCount in interface ISMRouterSetup2
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRestriction

public ISMRestriction getRestriction(int index)
                              throws IOException,
                                     AutomationException
Restriction at the position, specified by index.

Product Availability

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

Specified by:
getRestriction in interface ISMRouterSetup2
Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.datasourcesfile.ISMRestriction
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearRestriction

public void clearRestriction(int index)
                      throws IOException,
                             AutomationException
The method removes restriction at specified position from the list.

Product Availability

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

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