com.esri.arcgis.geometry
Interface IEnumSegment

All Superinterfaces:
Serializable
All Known Implementing Classes:
IEnumSegmentProxy

public interface IEnumSegment
extends Serializable

Provides access to members that iterate over collections of segments (obtained from the EnumSegments property on the ISegmentCollection interface).

Description

The methods on IEnumSegment interface can be used to access segments of a segment collection. Those methods are more efficient than the ISegmentCollection methods to access a large number of segments in a sequential order for polyline and polygon. The collection methods transform absolute segment index into a part relative index, enumerators don't.

Product Availability

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


Method Summary
 void esri_clone(IEnumSegment[] outEnumerator)
          Returns a copy of this enumerator positioned at the same segment.
 boolean isLastInPart()
          Indicates if the current segment is last in the current part.
 boolean isRecycling()
          Indicates if this enumerator re-uses the same segment each time next is called.
 void next(ISegment[] outSegment, int[] outPartIndex, int[] segmentIndex)
          Returns the next segment, and its location in the collection.
 void nextEx(_esriSegmentInfo[] outSegment)
          Populates a segment info structure with information on the next segment in the collection.
 void nextInPart(ISegment[] outSegment, int[] outSegmentIndex)
          Returns the next segment in current part, goes back to first segment after last segment in part is encountered.
 void nextInPartEx(_esriSegmentInfo[] outSegment)
          Returns the next segment info structure in current part, goes back to first segment after last segment in part is encountered.
 void previous(ISegment[] outSegment, int[] outPartIndex, int[] segmentIndex)
          Returns the previous segment in this segment collection.
 void reset()
          Starts from the beginning of the segment collection the next time Next is called.
 void resetToEnd()
          Starts from the end of the path, ring, polyline or polygon the next time Previous is called.
 void setAt(int iPart, int iSegment)
          Resets enumerator to specific location.
 void skip(int numSegments)
          Skips forward or backward over a specified number of segments.
 

Method Detail

nextEx

void nextEx(_esriSegmentInfo[] outSegment)
            throws IOException,
                   AutomationException
Populates a segment info structure with information on the next segment in the collection.

Description

The NextEx method advances the enumerator to the next position and returns the segment and the associated information using an esriSegmentInfo structure.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
outSegment - A Structure: com.esri.arcgis.geometry._esriSegmentInfo (A com.esri.arcgis.geometry._esriSegmentInfo COM typedef) (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

next

void next(ISegment[] outSegment,
          int[] outPartIndex,
          int[] segmentIndex)
          throws IOException,
                 AutomationException
Returns the next segment, and its location in the collection. If the location does not have parts (i.e. a path or ring) then the part index will always be zero.

Description

The NextEx method advances the enumerator to the next position, returns the segment, the part index and the segment index.

Remarks

See picture for a graphical explanation of some of the IEnumSegment methods.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
outSegment - A reference to a com.esri.arcgis.geometry.ISegment (out: use single element array)
outPartIndex - The outPartIndex (in/out: use single element array)
segmentIndex - The segmentIndex (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

skip

void skip(int numSegments)
          throws IOException,
                 AutomationException
Skips forward or backward over a specified number of segments.

Description

The skip method jumps over a given number of segments in ascending (positive number) or descending (negative number) order and set the enumerator at that position. For example, if the enumerator is in its initial position (ex: after reset) calling skip 2 will move the enumerator to the position just before segment index= 2, therefore calling next will return segment index = 2.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
numSegments - The numSegments (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

reset

void reset()
           throws IOException,
                  AutomationException
Starts from the beginning of the segment collection the next time Next is called.

Description

Reset the enumerator. For example, the following call to IEnumSegment::Next returns segment index = 0.

Remarks

See picture for a graphical explanation of some of the IEnumSegment methods.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

esri_clone

void esri_clone(IEnumSegment[] outEnumerator)
                throws IOException,
                       AutomationException
Returns a copy of this enumerator positioned at the same segment.

Product Availability

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

Parameters:
outEnumerator - A reference to a com.esri.arcgis.geometry.IEnumSegment (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

resetToEnd

void resetToEnd()
                throws IOException,
                       AutomationException
Starts from the end of the path, ring, polyline or polygon the next time Previous is called.

Description

The ResetToEnd method set the enumerator to its end. Using the Previous method in this situation will return the last segment of the last part.

Remarks

See picture for a graphical explanation of some of the IEnumSegment methods.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

previous

void previous(ISegment[] outSegment,
              int[] outPartIndex,
              int[] segmentIndex)
              throws IOException,
                     AutomationException
Returns the previous segment in this segment collection.

Description

The Previous method returns the segment before the current position. For example, if the enumerator is in position Part Index = 0 and Segment Index = 1, then calling previous will return the segment located at Part Index = 0 and Segment Index = 0.

Remarks

See picture for a graphical explanation of some of the IEnumSegment methods.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
outSegment - A reference to a com.esri.arcgis.geometry.ISegment (out: use single element array)
outPartIndex - The outPartIndex (in/out: use single element array)
segmentIndex - The segmentIndex (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAt

void setAt(int iPart,
           int iSegment)
           throws IOException,
                  AutomationException
Resets enumerator to specific location.

Description

The SetAt method allows setting the enumerator at any given location in the enumerator. Then using the Next method will return the specified segment. For example, using SetAt(1,0) followed by Next will return the segment located at Part Index = 1 and Segment Index = 0.

Remarks

See picture for a graphical explanation of some of the IEnumSegment methods.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
iPart - The iPart (in)
iSegment - The iSegment (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

nextInPartEx

void nextInPartEx(_esriSegmentInfo[] outSegment)
                  throws IOException,
                         AutomationException
Returns the next segment info structure in current part, goes back to first segment after last segment in part is encountered.

Description

The NextInPartEx method is returning the next segment in the current part along with more information about the segment than the NextInPart method. As oppose to the Next method the NextInpartEx method limits its search to the part where the enumerator is currently located. For example, if the enumerator is located on the last segment of a given part then NextInPartEx will return the first segment of that part.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
outSegment - A Structure: com.esri.arcgis.geometry._esriSegmentInfo (A com.esri.arcgis.geometry._esriSegmentInfo COM typedef) (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

nextInPart

void nextInPart(ISegment[] outSegment,
                int[] outSegmentIndex)
                throws IOException,
                       AutomationException
Returns the next segment in current part, goes back to first segment after last segment in part is encountered.

Description

The NextInPart method is returning the next segment in the current part. As oppose to the Next method the NextInpart method limits its search to the part where the enumerator is currently located. For example, if the enumerator is located on the last segment of a given part then NextInPartEx will return the first segment of that part.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
outSegment - A reference to a com.esri.arcgis.geometry.ISegment (out: use single element array)
outSegmentIndex - The outSegmentIndex (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isLastInPart

boolean isLastInPart()
                     throws IOException,
                            AutomationException
Indicates if the current segment is last in the current part.

Description

The IsLastInPart method returns 'True' if the enumerator is located on the last segment of a given part. For example, if a polyline has 2 parts and 3 segments in each part, IsLastInPart would return 'true' when the enumerator is located at Part Index = 0 Segment Index = 2 and Part Index = 1 Segment Index = 2.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

isRecycling

boolean isRecycling()
                    throws IOException,
                           AutomationException
Indicates if this enumerator re-uses the same segment each time next is called.

Description

The IsRecycling method indicates whether or not modifications to segments in the segment collection are seen or not by the enumerator. If 'True' then modifications to segments will not be seen by the enumerator, if 'False' then the enumerator is always up to date and represents the current state of the segment collection.

Remarks

Note: The IsRecycling state is contolled by the system and cannot be directly changed by users.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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