com.esri.arcgis.geodatabase
Class NetworkAttribute

java.lang.Object
  extended bycom.esri.arcgis.geodatabase.NetworkAttribute
All Implemented Interfaces:
IGPDescribe, INetworkAttribute, INetworkAttribute2, java.io.Serializable

public class NetworkAttribute
extends java.lang.Object
implements INetworkAttribute, INetworkAttribute2, IGPDescribe

A container for describing a network dataset attribute.

Product Availability

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

Description

A NetworkAttribute object is a light weight object that holds the information about a network attribute in a network dataset.

Network attributes control traversability over the network dataset. They specify properties of junctions, edge, and turns used as input for network solvers, such as time travel of road segments, speeds along a road, and whether a given road is one-way.

The NetworkAttribute or EvaluatedNetworkAttribute object for an existing network dataset can be accessed through the INetworkDataset interface.

See Also:
Serialized Form

Constructor Summary
NetworkAttribute()
          Constructs a NetworkAttribute using ArcGIS Engine.
NetworkAttribute(java.lang.Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
 
Method Summary
 java.lang.Object describe(java.lang.String name)
           
 boolean equals(java.lang.Object o)
          Compare this object with another
 IGPDescribe getAsIGPDescribe()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 INetworkAttribute getAsINetworkAttribute()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 INetworkAttribute2 getAsINetworkAttribute2()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
static java.lang.String getClsid()
           
 int getDataType()
          Type of data used in this network attribute.
 int getID()
          Unique identifier of this network attribute.
 java.lang.String getName()
          Name of this network attribute.
 IArray getParameters()
          Array of parameters.
 int getUnits()
          Units of this network attribute.
 int getUsageType()
          Usage type of this network attribute.
 int hashCode()
          the hashcode for this object
 boolean isUseByDefault()
          Indicates if this network attribute is to be used by default.
 void refresh()
          .
 void setDataType(int dataType)
          Type of data used in this network attribute.
 void setName(java.lang.String attributeName)
          Name of this network attribute.
 void setParametersByRef(IArray parameters)
          Array of parameters.
 void setUnits(int units)
          Units of this network attribute.
 void setUsageType(int usageType)
          Usage type of this network attribute.
 void setUseByDefault(boolean useByDefault)
          Indicates if this network attribute is to be used by default.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkAttribute

public NetworkAttribute()
                 throws java.io.IOException,
                        java.net.UnknownHostException
Constructs a NetworkAttribute using ArcGIS Engine.

Throws:
java.io.IOException - if there are interop problems
java.net.UnknownHostException - if there are interop problems

NetworkAttribute

public NetworkAttribute(java.lang.Object obj)
                 throws java.io.IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.

Construct a NetworkAttribute using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to NetworkAttribute.
NetworkAttribute theNetworkAttribute = (NetworkAttribute) obj;

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
java.io.IOException - if there are interop problems
Method Detail

getClsid

public static java.lang.String getClsid()

getAsINetworkAttribute

public INetworkAttribute getAsINetworkAttribute()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsINetworkAttribute2

public INetworkAttribute2 getAsINetworkAttribute2()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIGPDescribe

public IGPDescribe getAsIGPDescribe()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


equals

public boolean equals(java.lang.Object o)
Compare this object with another


hashCode

public int hashCode()
the hashcode for this object


getName

public java.lang.String getName()
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: INetworkAttribute
Name of this network attribute.

Specified by:
getName in interface INetworkAttribute
Returns:
The attributeName
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setName

public void setName(java.lang.String attributeName)
             throws java.io.IOException,
                    AutomationException
Description copied from interface: INetworkAttribute
Name of this network attribute.

Specified by:
setName in interface INetworkAttribute
Parameters:
attributeName - The attributeName (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getID

public int getID()
          throws java.io.IOException,
                 AutomationException
Description copied from interface: INetworkAttribute
Unique identifier of this network attribute.

Specified by:
getID in interface INetworkAttribute
Returns:
The attributeID
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDataType

public int getDataType()
                throws java.io.IOException,
                       AutomationException
Description copied from interface: INetworkAttribute
Type of data used in this network attribute.

Remarks

The DataType for the network attribute can be either Integer, Float, Double, or Boolean.

Depending on the UsageType for the network attribute, only certain DataTypes are allowed:

UsageType: Allowed DataTypes:
esriNAUTCost esriNADTInteger, esriNADTFloat, esriNADTDouble
esriNAUTDescriptor esriNADTInteger, esriNADTFloat, esriNADTDouble, esriNADTBoolean
esriNAUTRestriction esriNADTBoolean
esriNAUTHierarchy esriNADTInteger

Specified by:
getDataType in interface INetworkAttribute
Returns:
A com.esri.arcgis.geodatabase.esriNetworkAttributeDataType constant
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

setDataType

public void setDataType(int dataType)
                 throws java.io.IOException,
                        AutomationException
Description copied from interface: INetworkAttribute
Type of data used in this network attribute.

Specified by:
setDataType in interface INetworkAttribute
Parameters:
dataType - A com.esri.arcgis.geodatabase.esriNetworkAttributeDataType constant (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUsageType

public int getUsageType()
                 throws java.io.IOException,
                        AutomationException
Description copied from interface: INetworkAttribute
Usage type of this network attribute.

Remarks

The UsageType for the network attribute can be either Cost, Descriptor, Restriction, or Hierarchy.

Depending on the UsageType for the network attribute, only certain DataTypes are allowed:

UsageType: Allowed DataTypes:
esriNAUTCost esriNADTInteger, esriNADTFloat, esriNADTDouble
esriNAUTDescriptor esriNADTInteger, esriNADTFloat, esriNADTDouble, esriNADTBoolean
esriNAUTRestriction esriNADTBoolean
esriNAUTHierarchy esriNADTInteger

Specified by:
getUsageType in interface INetworkAttribute
Returns:
A com.esri.arcgis.geodatabase.esriNetworkAttributeUsageType constant
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

setUsageType

public void setUsageType(int usageType)
                  throws java.io.IOException,
                         AutomationException
Description copied from interface: INetworkAttribute
Usage type of this network attribute.

Specified by:
setUsageType in interface INetworkAttribute
Parameters:
usageType - A com.esri.arcgis.geodatabase.esriNetworkAttributeUsageType constant (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getUnits

public int getUnits()
             throws java.io.IOException,
                    AutomationException
Description copied from interface: INetworkAttribute
Units of this network attribute.

Remarks

If the attribute is not measured in units of distance or time, specify the Units as esriNAUUnknown.

Specified by:
getUnits in interface INetworkAttribute
Returns:
A com.esri.arcgis.geodatabase.esriNetworkAttributeUnits constant
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

setUnits

public void setUnits(int units)
              throws java.io.IOException,
                     AutomationException
Description copied from interface: INetworkAttribute
Units of this network attribute.

Specified by:
setUnits in interface INetworkAttribute
Parameters:
units - A com.esri.arcgis.geodatabase.esriNetworkAttributeUnits constant (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getParameters

public IArray getParameters()
                     throws java.io.IOException,
                            AutomationException
Description copied from interface: INetworkAttribute2
Array of parameters.

Remarks

This property provides access to the IArray interface that holds the collection of NetworkAttributeParameter objects that are available for this NetworkAttribute.

 

Specified by:
getParameters in interface INetworkAttribute2
Returns:
A reference to a com.esri.arcgis.system.IArray
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

setParametersByRef

public void setParametersByRef(IArray parameters)
                        throws java.io.IOException,
                               AutomationException
Description copied from interface: INetworkAttribute2
Array of parameters.

Specified by:
setParametersByRef in interface INetworkAttribute2
Parameters:
parameters - A reference to a com.esri.arcgis.system.IArray (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

refresh

public void refresh()
             throws java.io.IOException,
                    AutomationException
Description copied from interface: INetworkAttribute2
.

Remarks

Calling Refresh propogates the call to INetworkEvaluator2::Refresh on the attribute's underlying network evaluators that implement INetworkEvaluator2.  This gives the evaluator an opportunity to update its state based on current data or parameter values.  This method is called by the network analyst solvers after setting INetworkAttribute2::Parameters prior to performing the solve operation.

Specified by:
refresh in interface INetworkAttribute2
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isUseByDefault

public boolean isUseByDefault()
                       throws java.io.IOException,
                              AutomationException
Description copied from interface: INetworkAttribute2
Indicates if this network attribute is to be used by default.

Remarks

If the UseByDefault property is set to True for a NetworkAttribute, the network attribute will automatically be set as an option (e.g., impedance, restriction, hierarchy) when a new network analysis layer is created in ArcMap.

Specified by:
isUseByDefault in interface INetworkAttribute2
Returns:
The useByDefault
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setUseByDefault

public void setUseByDefault(boolean useByDefault)
                     throws java.io.IOException,
                            AutomationException
Description copied from interface: INetworkAttribute2
Indicates if this network attribute is to be used by default.

Specified by:
setUseByDefault in interface INetworkAttribute2
Parameters:
useByDefault - The useByDefault (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

describe

public java.lang.Object describe(java.lang.String name)
                          throws java.io.IOException,
                                 AutomationException
Specified by:
describe in interface IGPDescribe
Parameters:
name - The name (in)
Returns:
A Variant
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.