|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.geodatabase.NetworkFunctionEvaluator
public class NetworkFunctionEvaluator
A container for describing a network evaluator function.
This object is new at ArcGIS 9.3.
A NetworkFunctionEvaluator is an evaluator that assigns network attribute values by scaling or comparing the value of another attribute or parameter. Below are examples of expressions:
The NetworkFunctionEvaluator has its CacheAttribute property equal to False, unlike the NetworkConstantEvaluator and NetworkFieldEvaluator. This means that it does not evaluate its expression when the network is built, but when a network solver requires the result of that calculation. It is designed for dynamic analysis of a network under changing conditions.
Constructor Summary | |
---|---|
NetworkFunctionEvaluator()
Constructs a NetworkFunctionEvaluator using ArcGIS Engine. |
|
NetworkFunctionEvaluator(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. NetworkFunctionEvaluator theNetworkFunctionEvaluator = (NetworkFunctionEvaluator) obj; |
Method Summary | |
---|---|
Object |
describe(String name)
The description of the named object. |
boolean |
equals(Object o)
Compare this object with another |
static String |
getClsid()
getClsid. |
IUID |
getCLSID()
Unique CLSID identifier for this network evaluator. |
IPropertySet |
getData()
The data used by this network evaluator for custom properties. |
String |
getDisplayName()
Name displayed in the user interface for this network evaluator. |
Object |
getFirstArgument()
The attribute name or constant value representing the first argument of the function. |
String |
getName()
Unique name of this network evaluator. |
String |
getOperator()
The operator used in the function. |
IEnumBSTR |
getOperators(int returnDataType)
Get the list of supported binary operator names. |
IStringArray |
getRequiredFieldNames()
Required fields of this network evaluator. |
Object |
getSecondArgument()
The parameter name or constant value representing the second argument of the function. |
int |
hashCode()
the hashcode for this object |
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 |
isCacheAttribute()
Indicates if this evaluator's values should be computed and stored when the network is built or computed at run time and never stored. |
boolean |
isDataHasEdits()
Indicates if the data for this evaluator has been edited. |
Object |
queryValue(INetworkElement element,
IRow row)
Evaluates the attribute value of a network element. |
void |
refresh()
Refresh custom data for this network evaluator to synchronize with updated attribute parameter values or other external data. |
void |
setData(IPropertySet data)
The data used by this network evaluator for custom properties. |
void |
setFirstArgument(Object arg1)
The attribute name or constant value representing the first argument of the function. |
void |
setOperator(String op)
The operator used in the function. |
void |
setSecondArgument(Object arg2)
The parameter name or constant value representing the second argument of the function. |
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,
String[] errorDescription,
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,
String[] errorDescription,
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. |
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 NetworkFunctionEvaluator() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic NetworkFunctionEvaluator(Object obj) throws IOException
NetworkFunctionEvaluator theNetworkFunctionEvaluator = (NetworkFunctionEvaluator) obj;
obj
to NetworkFunctionEvaluator
.
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 String getName() throws IOException, AutomationException
getName
in interface INetworkEvaluator
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getDisplayName() throws IOException, AutomationException
The DisplayName is the name for the evaluator that will be displayed in the Type column of the Evaluators dialog in ArcCatalog.
getDisplayName
in interface INetworkEvaluator
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isCacheAttribute() throws IOException, AutomationException
The CacheAttribute property determines whether the values computed by this evaluator are stored in the logical network of the network dataset.
If the CacheAttribute property is set to True, then the attribute values are computed by the evaluator only when the network is built. The computed attribute values are then stored in the logical network. When a client queries for attribute values (such as during a network analysis), the attribute values are retrieved from the logical network.
If the CacheAttribute property is set to False, then the attribute values are computed by the evaluator whenever any client asks for an attribute value (such as during a network analysis). The computed attribute values are not stored in the logical network. Depending on the complexity of the evaluator, this operation can be much slower than looking up values stored in the logical network.
isCacheAttribute
in interface INetworkEvaluator
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IStringArray getRequiredFieldNames() throws IOException, AutomationException
RequiredFieldNames returns the field names that the evaluator requires in order to correctly evaluate the row. This property is used to minimize the data that is returned by the query to the database by only returning the required fields. Return a NULL pointer if you want it to include all the field names in the query.
getRequiredFieldNames
in interface INetworkEvaluator2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void refresh() throws IOException, AutomationException
The Refresh method is an opportunity to update any internal state within the evaluator based on changes to parameters, dynamic data feeds, etc. The Refresh method is called on every evaluator assigned to a network attribute when INetworkAttribute2::Refresh() is called. For example, this is called internally during a solve operation after setting the network attribute parameters and prior to performing the actual solve.
refresh
in interface INetworkEvaluator2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void initialize(INetworkDataset networkDataset, IDENetworkDataset dataElement, INetworkSource source, IEvaluatedNetworkAttribute attribute) throws IOException, AutomationException
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.
initialize
in interface INetworkEvaluatorSetup
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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setData(IPropertySet data) throws IOException, AutomationException
setData
in interface INetworkEvaluatorSetup
data
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IPropertySet getData() throws IOException, AutomationException
The Data property stores data that is needed by the evaluator. It is stored in a PropertySet object using key-value pairs.
getData
in interface INetworkEvaluatorSetup
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isDataHasEdits() throws IOException, AutomationException
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.
isDataHasEdits
in interface INetworkEvaluatorSetup
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IUID getCLSID() throws IOException, AutomationException
getCLSID
in interface INetworkEvaluatorSetup
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean supportsSource(INetworkSource source, IEvaluatedNetworkAttribute attribute) throws IOException, AutomationException
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.
supportsSource
in interface INetworkEvaluatorSetup
source
- A reference to a com.esri.arcgis.geodatabase.INetworkSource (in)attribute
- A reference to a com.esri.arcgis.geodatabase.IEvaluatedNetworkAttribute (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean supportsDefault(int elementType, IEvaluatedNetworkAttribute attribute) throws IOException, AutomationException
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.
supportsDefault
in interface INetworkEvaluatorSetup
elementType
- A com.esri.arcgis.geodatabase.esriNetworkElementType constant (in)attribute
- A reference to a com.esri.arcgis.geodatabase.IEvaluatedNetworkAttribute (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean validateSource(IDatasetContainer2 datasetContainer, INetworkSource networkSource, IEvaluatedNetworkAttribute attribute, int[] errorCode, String[] errorDescription, String[] errorAppendInfo) throws IOException, AutomationException
validateSource
in interface INetworkEvaluatorSetup
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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean validateDefault(int elementType, IEvaluatedNetworkAttribute attribute, int[] errorCode, String[] errorDescription, String[] errorAppendInfo) throws IOException, AutomationException
validateDefault
in interface INetworkEvaluatorSetup
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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object queryValue(INetworkElement element, IRow row) throws IOException, AutomationException
QueryValue uses this evaluator to compute the attribute value for the given network 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 when building the network dataset. When computing attribute values that will be cached within the network, QueryValue is automatically called by the system, and the Row from the corresponding source feature will be passed into QueryValue.
Note that QueryValue is also automatically called by the system when querying non-cached attribute values by using the INetworkElement interface. In this situation, the Row parameter will always be null; that is, the Row from the corresponding source feature will not be passed into QueryValue.
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.
queryValue
in interface INetworkEvaluatorSetup
element
- A reference to a com.esri.arcgis.geodatabase.INetworkElement (in)row
- A reference to a com.esri.arcgis.geodatabase.IRow (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setFirstArgument(Object arg1) throws IOException, AutomationException
setFirstArgument
in interface INetworkFunctionEvaluator
arg1
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getFirstArgument() throws IOException, AutomationException
The FirstArgument must be the name of a NetworkAttribute or a constant value.
If the FirstArgument is a constant value, it should be of the same DataType for the network attribute to which this evaluator is assigned.
getFirstArgument
in interface INetworkFunctionEvaluator
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOperator(String op) throws IOException, AutomationException
setOperator
in interface INetworkFunctionEvaluator
op
- The op (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getOperator() throws IOException, AutomationException
The Operator must be set to one of the operators returned in GetOperators.
getOperator
in interface INetworkFunctionEvaluator
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSecondArgument(Object arg2) throws IOException, AutomationException
The SecondArgument must be the name of a NetworkAttributeParameter or a constant value.
If the SecondArgument is a constant value, it should be of the same DataType for the network attribute to which this evaluator is assigned.
setSecondArgument
in interface INetworkFunctionEvaluator
arg2
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getSecondArgument() throws IOException, AutomationException
The SecondArgument must be the name of a NetworkAttributeParameter or a constant value.
If the SecondArgument is a constant value, it should be of the same DataType for the network attribute to which this evaluator is assigned.
getSecondArgument
in interface INetworkFunctionEvaluator
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IEnumBSTR getOperators(int returnDataType) throws IOException, AutomationException
GetOperators returned the list of valid operators that can be used in a NetworkFunctionEvaluator for a given network attribute DataType.
For numeric data types, the valid operators are:
For the Boolean data type, the valid operators are
getOperators
in interface INetworkFunctionEvaluator
returnDataType
- A com.esri.arcgis.geodatabase.esriNetworkAttributeDataType constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object describe(String name) throws IOException, AutomationException
describe
in interface IGPDescribe
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |