com.esri.arcgis.geodatabase
Interface INetworkEvaluatorSetup

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
INetworkEvaluatorSetupProxy, NetworkConstantEvaluator, NetworkFieldEvaluator, NetworkScriptEvaluator

public interface INetworkEvaluatorSetup
extends java.io.Serializable

Provides access to members that set up a network evaluator for use within a network dataset.

Product Availability

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

Remarks

The INetworkEvaluatorSetup and INetworkEvaluator interfaces contain methods that one should implement when writing a custom evaluator.

The methods on INetworkEvaluatorSetup are called by the evaluator framework of the network dataset, and are not typically called by client ArcObjects code.


Method Summary
 IUID getCLSID()
          Unique CLSID identifier for this network evaluator.
 IPropertySet getData()
          The data used by this network evaluator for custom properties.
 void initialize(INetworkDataset networkDataset, IDENetworkDataset dataElement, INetworkSource source, IEvaluatedNetworkAttribute attribute)
          Initializes the network evaluator in preparation to evaluate the attribute value of a network element.
 boolean isDataHasEdits()
          Indicates if the data for this evaluator has been edited.
 java.lang.Object queryValue(INetworkElement element, IRow row)
          Evaluates the attribute value of a network element.
 void setData(IPropertySet data)
          The data used by this network evaluator for custom properties.
 boolean supportsDefault(int elementType, IEvaluatedNetworkAttribute attribute)
          Indicates if this network evaluator can be used as the default evaluator for the given network element type and network attribute.
 boolean supportsSource(INetworkSource source, IEvaluatedNetworkAttribute attribute)
          Indicates if this network evaluator can be used as the evaluator for the given network source and network attribute.
 boolean validateDefault(int elementType, IEvaluatedNetworkAttribute attribute, int[] errorCode, java.lang.String[] errorDescription, java.lang.String[] errorAppendInfo)
          Indicates if the network evaluator is in a valid state for use as the default evaluator for the given element type and network attribute.
 boolean validateSource(IDatasetContainer2 datasetContainer, INetworkSource networkSource, IEvaluatedNetworkAttribute attribute, int[] errorCode, java.lang.String[] errorDescription, java.lang.String[] errorAppendInfo)
          Indicates if the network evaluator is in a valid state for use as the evaluator for the given network source and network attribute.
 

Method Detail

initialize

public void initialize(INetworkDataset networkDataset,
                       IDENetworkDataset dataElement,
                       INetworkSource source,
                       IEvaluatedNetworkAttribute attribute)
                throws java.io.IOException,
                       AutomationException
Initializes the network evaluator in preparation to evaluate the attribute value of a network element.

Remarks

The Initialize method does all the "heavy lifting" needed to prepare the evaluator for a call to QueryValue, a lightweight method for querying the attribute value for a network element.  Once the evaluator is initialized, the client can make multiple calls to this lightweight QueryValue for calculating the attribute values of multiple network elements.

When querying for attribute values in the network dataset ArcGIS calls the Initialize method immediately after it instantiates the evaluator.  For evaluators with CacheAttribute = True, this occurs when building the network dataset.  For evaluators with CacheAttribute = False, this occurs on the first call in the session to INetworkElement::AttributeValue or ::AttributeValueByName that requires this evaluator to determine the attribute value.

Parameters:
networkDataset - A reference to a com.esri.arcgis.geodatabase.INetworkDataset (in)
dataElement - A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
source - A reference to a com.esri.arcgis.geodatabase.INetworkSource (in)
attribute - A reference to a com.esri.arcgis.geodatabase.IEvaluatedNetworkAttribute (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setData

public void setData(IPropertySet data)
             throws java.io.IOException,
                    AutomationException
The data used by this network evaluator for custom properties.

Parameters:
data - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getData

public IPropertySet getData()
                     throws java.io.IOException,
                            AutomationException
The data used by this network evaluator for custom properties.

Remarks

The Data property stores data that is needed by the evaluator.  It is stored in a PropertySet object using key-value pairs.

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

isDataHasEdits

public boolean isDataHasEdits()
                       throws java.io.IOException,
                              AutomationException
Indicates if the data for this evaluator has been edited.

Remarks

The DataHasEdits property indicates whether changes have been made to the Data PropertySet that have not yet been handled by the evaluator's internal logic.  This is useful in determining whether the evaluator needs to be re-Initialized before making additional calls to QueryValue.

This property is only used when modifying the network dataset's evaluators via objects like the EvaluatorEditor to signify the network dataset may need to be rebuilt/reinitialized.  This property is not queried prior to network analysis to determine if the evaluator needs to be re-initialized.  Thus, it is not a mechanism to trigger that the evaluators need to be re-initialized based on new data between solves.

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

getCLSID

public IUID getCLSID()
              throws java.io.IOException,
                     AutomationException
Unique CLSID identifier for this network evaluator.

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

supportsSource

public boolean supportsSource(INetworkSource source,
                              IEvaluatedNetworkAttribute attribute)
                       throws java.io.IOException,
                              AutomationException
Indicates if this network evaluator can be used as the evaluator for the given network source and network attribute.

Remarks

TheSupportsSource method is used to determine if the evaluator can be used to assign attribute values for elements generated by the given source.  If SupportsSource is False, then the evaluator does not show up as a choice for the user in the Evaluators dialog in ArcCatalog.

Parameters:
source - A reference to a com.esri.arcgis.geodatabase.INetworkSource (in)
attribute - A reference to a com.esri.arcgis.geodatabase.IEvaluatedNetworkAttribute (in)
Returns:
The isSupported
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

supportsDefault

public boolean supportsDefault(int elementType,
                               IEvaluatedNetworkAttribute attribute)
                        throws java.io.IOException,
                               AutomationException
Indicates if this network evaluator can be used as the default evaluator for the given network element type and network attribute.

Remarks

The SupportsDefault method is used to determine if the evaluator can be used to assign default attribute values for elements of the given type.  If SupportsDefault is False, then the evaluator does not show up as a default evaluator choice for the user in the Evaluators dialog in ArcCatalog.

Parameters:
elementType - A com.esri.arcgis.geodatabase.esriNetworkElementType constant (in)
attribute - A reference to a com.esri.arcgis.geodatabase.IEvaluatedNetworkAttribute (in)
Returns:
The isSupported
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

validateSource

public boolean validateSource(IDatasetContainer2 datasetContainer,
                              INetworkSource networkSource,
                              IEvaluatedNetworkAttribute attribute,
                              int[] errorCode,
                              java.lang.String[] errorDescription,
                              java.lang.String[] errorAppendInfo)
                       throws java.io.IOException,
                              AutomationException
Indicates if the network evaluator is in a valid state for use as the evaluator for the given network source and network attribute.

Parameters:
datasetContainer - A reference to a com.esri.arcgis.geodatabase.IDatasetContainer2 (in)
networkSource - A reference to a com.esri.arcgis.geodatabase.INetworkSource (in)
attribute - A reference to a com.esri.arcgis.geodatabase.IEvaluatedNetworkAttribute (in)
errorCode - The errorCode (in/out: use single element array)
errorDescription - The errorDescription (in/out: use single element array)
errorAppendInfo - The errorAppendInfo (in/out: use single element array)
Returns:
The isValid
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

validateDefault

public boolean validateDefault(int elementType,
                               IEvaluatedNetworkAttribute attribute,
                               int[] errorCode,
                               java.lang.String[] errorDescription,
                               java.lang.String[] errorAppendInfo)
                        throws java.io.IOException,
                               AutomationException
Indicates if the network evaluator is in a valid state for use as the default evaluator for the given element type and network attribute.

Parameters:
elementType - A com.esri.arcgis.geodatabase.esriNetworkElementType constant (in)
attribute - A reference to a com.esri.arcgis.geodatabase.IEvaluatedNetworkAttribute (in)
errorCode - The errorCode (in/out: use single element array)
errorDescription - The errorDescription (in/out: use single element array)
errorAppendInfo - The errorAppendInfo (in/out: use single element array)
Returns:
The isValid
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryValue

public java.lang.Object queryValue(INetworkElement element,
                                   IRow row)
                            throws java.io.IOException,
                                   AutomationException
Evaluates the attribute value of a network element.

Remarks

QueryValue computes the attribute value for the given element.  The Row parameter is provided in order to query any information from the Row (such as field values) corresponding to the given network element.

Before calling QueryValue, the evaluator must first be initialized by calling the Initialize method.  After calling Initialize, QueryValue can be called multiple times to calculate attribute values for multiple network elements.

Parameters:
element - A reference to a com.esri.arcgis.geodatabase.INetworkElement (in)
row - A reference to a com.esri.arcgis.geodatabase.IRow (in)
Returns:
A Variant
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.