com.esri.arcgis.geodatabase
Class NetworkForwardStar

java.lang.Object
  extended by com.esri.arcgis.geodatabase.NetworkForwardStar
All Implemented Interfaces:
INetworkForwardStar, INetworkForwardStarSetup, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class NetworkForwardStar
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, INetworkForwardStar, INetworkForwardStarSetup

A container for querying information about adjacent elements in the network dataset.

Description

For a given network junction element (and optionally incoming edge elements) in a network dataset, the NetworkForwardStar object efficiently queries adjacent network elements and their attribute values. This query can be performed repeatedly using the NetworkForwardStar on nearby elements, allowing one to traverse throughout the network to perform a network analysis.

Remarks

The NetworkForwardStar object is created by calling the INetworkQuery::CreateForwardStar method on the network dataset. This method can only be called when a Network license is checked out.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
NetworkForwardStar(Object obj)
          Construct a NetworkForwardStar using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 void addCachedAttribute(INetworkAttribute attribute)
          Adds a network attribute to the NetworkForwardStar object for optimized querying of element attribute values.
 void addRestriction(INetworkAttribute attribute)
          Adds a restriction network attribute to the NetworkForwardStar object to filter elements returned.
 boolean equals(Object o)
          Compare this object with another
 int getBacktrack()
          Policy on whether to filter the from-edge element from the output NetworkForwardStarAdjacencies object.
 INetworkAttribute getHierarchyAttribute()
          Network attribute containing the hierarchy values for each network element.
 int getMaxHierarchyValue()
          Maximum hierarchy attribute value permitted to be returned in the NetworkForwardStarAdjacencies object.
 INetworkDataset getNetworkDataset()
          Network dataset on which the forward star object is querying.
 IEnumNetworkElement getNonTraversableElements(int elementType, int direction)
          The collection of network elements of the given type that are set to not traversable.
 INetworkAttribute getRestriction(int index)
          Restriction network attribute by index applied to the NetworkForwardStar object.
 int getRestrictionCount()
          Number of restriction network attributes applied to the NetworkForwardStar object.
 int hashCode()
          the hashcode for this object
 boolean isFiltered(INetworkElement element)
          Indicates if the given network element is filtered out from the adjacencies object.
 boolean isForwardTraversal()
          Indicates if the forward star is used to model forward traversal through the network dataset.
 boolean isTraversable(INetworkElement element)
          Indicates if the given network element is travserable by the NetworkForwardStar object.
 void queryAdjacencies(INetworkJunction atJunction, INetworkEdge fromEdge, INetworkEdge lastExteriorEdge, INetworkForwardStarAdjacencies adjacencies)
          Finds all network elements that are adjacent to the given sequence of network elements.
 void removeAllCachedAttributes()
          Clears the collection of attributes that are cached.
 void removeRestriction(int index)
          Removes the given restriction network attribute by index from the NetworkForwardStar object.
 void setAllTraversable(int elementType, boolean traversable)
          Sets all network elements of the given element type to be traversable or non-traversable.
 void setBacktrack(int backtrack)
          Policy on whether to filter the from-edge element from the output NetworkForwardStarAdjacencies object.
 void setHierarchyAttributeByRef(INetworkAttribute attribute)
          Network attribute containing the hierarchy values for each network element.
 void setIsForwardTraversal(boolean isForwardTraversal)
          Indicates if the forward star is used to model forward traversal through the network dataset.
 void setMaxHierarchyValue(int maxValue)
          Maximum hierarchy attribute value permitted to be returned in the NetworkForwardStarAdjacencies object.
 void setTraversable(INetworkElement element, boolean traversable)
          Indicates if the given network element is travserable by the NetworkForwardStar object.
 void setTraversable2(IEnumNetworkElement elements, boolean traversable)
          Sets the given network elements to be traversable or non-traversable.
 
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

NetworkForwardStar

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

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

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

queryAdjacencies

public void queryAdjacencies(INetworkJunction atJunction,
                             INetworkEdge fromEdge,
                             INetworkEdge lastExteriorEdge,
                             INetworkForwardStarAdjacencies adjacencies)
                      throws IOException,
                             AutomationException
Finds all network elements that are adjacent to the given sequence of network elements.

Remarks

The last parameter requires an instantiated NetworkForwardStarAdjacencies object to return the adjacent elements found when calling QueryAdjacencies. The NetworkForwardStarAdjacencies object is created using the INetworkQuery::CreateForwardStarAdjacencies method. The NetworkForwardStarAdjacencies object should be reused in subsequent calls to QueryAdjacencies.

Product Availability

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

Specified by:
queryAdjacencies in interface INetworkForwardStar
Parameters:
atJunction - A reference to a com.esri.arcgis.geodatabase.INetworkJunction (in)
fromEdge - A reference to a com.esri.arcgis.geodatabase.INetworkEdge (in)
lastExteriorEdge - A reference to a com.esri.arcgis.geodatabase.INetworkEdge (in)
adjacencies - A reference to a com.esri.arcgis.geodatabase.INetworkForwardStarAdjacencies (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isFiltered

public boolean isFiltered(INetworkElement element)
                   throws IOException,
                          AutomationException
Indicates if the given network element is filtered out from the adjacencies object.

Product Availability

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

Specified by:
isFiltered in interface INetworkForwardStar
Parameters:
element - A reference to a com.esri.arcgis.geodatabase.INetworkElement (in)
Returns:
The isFiltered
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBacktrack

public int getBacktrack()
                 throws IOException,
                        AutomationException
Policy on whether to filter the from-edge element from the output NetworkForwardStarAdjacencies object.

Remarks

The Backtrack property determines whether or not to return the network edge element (and the corresponding junction and turn elements) that is in the reverse direction of the network edge in the fromEdge parameter of INetworkForwardStar::QueryAdjacencies.

Product Availability

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

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

setBacktrack

public void setBacktrack(int backtrack)
                  throws IOException,
                         AutomationException
Policy on whether to filter the from-edge element from the output NetworkForwardStarAdjacencies object.

Product Availability

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

Specified by:
setBacktrack in interface INetworkForwardStarSetup
Parameters:
backtrack - A com.esri.arcgis.geodatabase.esriNetworkForwardStarBacktrack constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isForwardTraversal

public boolean isForwardTraversal()
                           throws IOException,
                                  AutomationException
Indicates if the forward star is used to model forward traversal through the network dataset.

Remarks

The IsForwardTraversal property determines in which direction the NetworkForwardStar object is querying the edge elements that are adjacent to the junction element in the atJunction parameter of the INetworkForwardStar::QueryAdjacencies method. If IsForwardTraversal is True, then the NetworkForwardStar object is querying edge elements and their attribute values in the direction leaving the atJunction junction element. If IsForwardTraversal is False, then the NetworkForwardStar object is querying edge elements and their attribute values in the direction entering the atJunction junction element.

Product Availability

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

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

setIsForwardTraversal

public void setIsForwardTraversal(boolean isForwardTraversal)
                           throws IOException,
                                  AutomationException
Indicates if the forward star is used to model forward traversal through the network dataset.

Product Availability

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

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

getNetworkDataset

public INetworkDataset getNetworkDataset()
                                  throws IOException,
                                         AutomationException
Network dataset on which the forward star object is querying.

Product Availability

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

Specified by:
getNetworkDataset in interface INetworkForwardStarSetup
Returns:
A reference to a com.esri.arcgis.geodatabase.INetworkDataset
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addCachedAttribute

public void addCachedAttribute(INetworkAttribute attribute)
                        throws IOException,
                               AutomationException
Adds a network attribute to the NetworkForwardStar object for optimized querying of element attribute values.

Remarks

This method has been deprecated and should not be called.

Product Availability

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

Specified by:
addCachedAttribute in interface INetworkForwardStarSetup
Parameters:
attribute - A reference to a com.esri.arcgis.geodatabase.INetworkAttribute (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeAllCachedAttributes

public void removeAllCachedAttributes()
                               throws IOException,
                                      AutomationException
Clears the collection of attributes that are cached.

Remarks

This method has been deprecated and should not be called.

Product Availability

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

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

addRestriction

public void addRestriction(INetworkAttribute attribute)
                    throws IOException,
                           AutomationException
Adds a restriction network attribute to the NetworkForwardStar object to filter elements returned.

Remarks

The AddRestriction method adds a NetworkAttribute to the NetworkForwardStar object. This prevents network elements that have an attribute value of True from being returned by the forward star QueryAdjacencies. This is useful when performing a network analysis only on those network elements that permit travel.

Only a NetworkAttribute with a UsageType of esriNAUTRestriction can be added to the NetworkForwardStar as a restriction.

Product Availability

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

Specified by:
addRestriction in interface INetworkForwardStarSetup
Parameters:
attribute - A reference to a com.esri.arcgis.geodatabase.INetworkAttribute (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRestriction

public INetworkAttribute getRestriction(int index)
                                 throws IOException,
                                        AutomationException
Restriction network attribute by index applied to the NetworkForwardStar object.

Product Availability

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

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

getRestrictionCount

public int getRestrictionCount()
                        throws IOException,
                               AutomationException
Number of restriction network attributes applied to the NetworkForwardStar object.

Product Availability

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

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

removeRestriction

public void removeRestriction(int index)
                       throws IOException,
                              AutomationException
Removes the given restriction network attribute by index from the NetworkForwardStar object.

Remarks

The RemoveRestriction method removes the NetworkAttribute at the specified index from being used as a restriction in the NetworkForwardStar object. The network attribute was added as a Restriction using the AddRestriction method.

The index values range from 0 to (RestrictionCount - 1).

Product Availability

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

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

setHierarchyAttributeByRef

public void setHierarchyAttributeByRef(INetworkAttribute attribute)
                                throws IOException,
                                       AutomationException
Network attribute containing the hierarchy values for each network element.

Product Availability

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

Specified by:
setHierarchyAttributeByRef in interface INetworkForwardStarSetup
Parameters:
attribute - A reference to a com.esri.arcgis.geodatabase.INetworkAttribute (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHierarchyAttribute

public INetworkAttribute getHierarchyAttribute()
                                        throws IOException,
                                               AutomationException
Network attribute containing the hierarchy values for each network element.

Remarks

The HierarchyAttribute is the NetworkAttribute used in determining at what hierarchy level is a given network edge element. The NetworkForwardStar object will only return network edge elements whose hierarchy level is less than or equal to the MaxHierarchyValue value.

The HierarchyAttribute must be a NetworkAttribute with a UsageType of esriNAUTHierarchy.

Product Availability

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

Specified by:
getHierarchyAttribute in interface INetworkForwardStarSetup
Returns:
A reference to a com.esri.arcgis.geodatabase.INetworkAttribute
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMaxHierarchyValue

public void setMaxHierarchyValue(int maxValue)
                          throws IOException,
                                 AutomationException
Maximum hierarchy attribute value permitted to be returned in the NetworkForwardStarAdjacencies object.

Product Availability

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

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

getMaxHierarchyValue

public int getMaxHierarchyValue()
                         throws IOException,
                                AutomationException
Maximum hierarchy attribute value permitted to be returned in the NetworkForwardStarAdjacencies object.

Remarks

If a HierarchyAttribute is specified, then the NetworkForwardStar object will only return network edge elements whose HierarchyAttribute value is less than or equal to the MaxHierarchyValue value.

Product Availability

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

Specified by:
getMaxHierarchyValue in interface INetworkForwardStarSetup
Returns:
The maxValue
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isTraversable

public boolean isTraversable(INetworkElement element)
                      throws IOException,
                             AutomationException
Indicates if the given network element is travserable by the NetworkForwardStar object.

Product Availability

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

Specified by:
isTraversable in interface INetworkForwardStarSetup
Parameters:
element - A reference to a com.esri.arcgis.geodatabase.INetworkElement (in)
Returns:
The traversable
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTraversable

public void setTraversable(INetworkElement element,
                           boolean traversable)
                    throws IOException,
                           AutomationException
Indicates if the given network element is travserable by the NetworkForwardStar object.

Remarks

The SetTraversable method with a Traversable parameter value of True sets all network elements in the given enumeration as Traversable.

The SetTraversable method with a Traversable parameter value of False sets all network elements in the given enumeration as not Traversable.

Product Availability

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

Specified by:
setTraversable in interface INetworkForwardStarSetup
Parameters:
element - A reference to a com.esri.arcgis.geodatabase.INetworkElement (in)
traversable - The traversable (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTraversable2

public void setTraversable2(IEnumNetworkElement elements,
                            boolean traversable)
                     throws IOException,
                            AutomationException
Sets the given network elements to be traversable or non-traversable.

Product Availability

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

Specified by:
setTraversable2 in interface INetworkForwardStarSetup
Parameters:
elements - A reference to a com.esri.arcgis.geodatabase.IEnumNetworkElement (in)
traversable - The traversable (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAllTraversable

public void setAllTraversable(int elementType,
                              boolean traversable)
                       throws IOException,
                              AutomationException
Sets all network elements of the given element type to be traversable or non-traversable.

Remarks

The SetAllTraversable method with a Traversable parameter value of True sets all network elements of the given element type as Traversable.

The SetAllTraversable method with a Traversable parameter value of False sets all network elements of the given element type as not Traversable.

Product Availability

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

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

getNonTraversableElements

public IEnumNetworkElement getNonTraversableElements(int elementType,
                                                     int direction)
                                              throws IOException,
                                                     AutomationException
The collection of network elements of the given type that are set to not traversable.

Product Availability

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

Specified by:
getNonTraversableElements in interface INetworkForwardStarSetup
Parameters:
elementType - A com.esri.arcgis.geodatabase.esriNetworkElementType constant (in)
direction - A com.esri.arcgis.geodatabase.esriNetworkEdgeDirection constant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumNetworkElement
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.