com.esri.arcgis.geodatabase
Class NetworkAttribute

java.lang.Object
  extended by com.esri.arcgis.geodatabase.NetworkAttribute
All Implemented Interfaces:
INetworkAttribute, INetworkAttribute2, INetworkAttribute3, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class NetworkAttribute
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, INetworkAttribute, INetworkAttribute2, INetworkAttribute3

A container for describing a network dataset attribute.

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.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
NetworkAttribute(Object obj)
          Construct a NetworkAttribute using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 int getDataType()
          Type of data used in this network attribute.
 int getID()
          Unique identifier of this network attribute.
 String getName()
          Name of this network attribute.
 IArray getParameters()
          Array of parameters for this network attribute.
 int getUnits()
          Units of this network attribute.
 int getUsageType()
          Usage type of this network attribute.
 int hashCode()
          the hashcode for this object
 boolean isTimeAware(int elementType)
          Indicates if the network attribute is time aware.
 boolean isUseByDefault()
          Indicates if this network attribute is to be used by default.
 void refresh()
          Refresh the network evaluators assigned to this network attribute.
 void setDataType(int dataType)
          Type of data used in this network attribute.
 void setName(String attributeName)
          Name of this network attribute.
 void setParametersByRef(IArray parameters)
          Array of parameters for this network attribute.
 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
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

NetworkAttribute

public NetworkAttribute(Object obj)
                 throws IOException
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.
Casting to this class from the return value of a method will not work, as this class represents an abstract class in ArcObjects.
*
NetworkAttribute o = (NetworkAttribute)obj; // will not work

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

Throws:
IOException - if there are interop problems NetworkAttribute theNetworkAttribute = (NetworkAttribute) 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

getName

public String getName()
               throws IOException,
                      AutomationException
Name of this network attribute.

Product Availability

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

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

setName

public void setName(String attributeName)
             throws IOException,
                    AutomationException
Name of this network attribute.

Product Availability

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

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

getID

public int getID()
          throws IOException,
                 AutomationException
Unique identifier of this network attribute.

Product Availability

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

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

getDataType

public int getDataType()
                throws IOException,
                       AutomationException
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

Product Availability

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

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

setDataType

public void setDataType(int dataType)
                 throws IOException,
                        AutomationException
Type of data used in this network attribute.

Product Availability

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

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

getUsageType

public int getUsageType()
                 throws IOException,
                        AutomationException
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

Product Availability

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

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

setUsageType

public void setUsageType(int usageType)
                  throws IOException,
                         AutomationException
Usage type of this network attribute.

Product Availability

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

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

getUnits

public int getUnits()
             throws IOException,
                    AutomationException
Units of this network attribute.

Remarks

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

Product Availability

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

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

setUnits

public void setUnits(int units)
              throws IOException,
                     AutomationException
Units of this network attribute.

Product Availability

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

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

getParameters

public IArray getParameters()
                     throws IOException,
                            AutomationException
Array of parameters for this network attribute.

Remarks

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

Product Availability

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

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

setParametersByRef

public void setParametersByRef(IArray parameters)
                        throws IOException,
                               AutomationException
Array of parameters for this network attribute.

Remarks

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

Product Availability

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

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

refresh

public void refresh()
             throws IOException,
                    AutomationException
Refresh the network evaluators assigned to this network attribute.

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.

Product Availability

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

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

isUseByDefault

public boolean isUseByDefault()
                       throws IOException,
                              AutomationException
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.

Product Availability

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

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

setUseByDefault

public void setUseByDefault(boolean useByDefault)
                     throws IOException,
                            AutomationException
Indicates if this network attribute is to be used by default.

Product Availability

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

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

isTimeAware

public boolean isTimeAware(int elementType)
                    throws IOException,
                           AutomationException
Indicates if the network attribute is time aware.

Product Availability

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

Specified by:
isTimeAware in interface INetworkAttribute3
Parameters:
elementType - A com.esri.arcgis.geodatabase.esriNetworkElementType constant (in)
Returns:
The isTimeAware
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.