Package com.esri.core.geometry
Class SegmentIterator
java.lang.Object
com.esri.core.geometry.SegmentIterator
This class provides functionality to iterate over MultiPath segments.
Example:
SegmentIterator iterator = polygon.querySegmentIterator();
while (iterator.nextPath()) {
while (iterator.hasNextSegment()) {
Segment segment = iterator.nextSegment();
}
}
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
_getImpl()
copy()
Copies this SegmentIterator.int
Returns the index of the end point of the current segment.int
Returns the index of the current path.int
Returns the index of the start point of this segment.boolean
Indicates whether a next segment exists for the path.boolean
Indicates whether a previous segment exists in the path.boolean
Returns TRUE, if the segment is the closing segment of the closed pathboolean
Indicates whether the iterator points to the first segment in the current path.boolean
Indicates whether the iterator points to the last segment in the current path.boolean
nextPath()
Moves the iterator to the next path.Moves the iterator to the next segment and returns the segment.boolean
Moves the iterator to the previous path.Moves the iterator to previous segment and returns the segment.void
Resets the iterator such that a subsequent call to NextPath will set the iterator to the first path.void
Resets the iterator so that the call to NextSegment will return the first segment of the current path.void
Resets the iterator such that a subsequent call to PreviousPath will set the iterator to the last path.void
Resets the iterator so that the call to PreviousSegment will return the last segment of the current path.void
resetToPath
(int pathIndex) Resets the iterator such that a subsequent call to NextPath will set the iterator to the given path index.void
resetToVertex
(int vertexIndex, int pathIndex) Resets the iterator to a specific vertex.void
setCirculator
(boolean bYesNo) Switches the iterator to navigation mode.
-
Field Details
-
m_impl
-
-
Constructor Details
-
SegmentIterator
SegmentIterator(Object obj)
-
-
Method Details
-
nextPath
public boolean nextPath()Moves the iterator to the next path. Returns the TRUE if successful.- Returns:
- TRUE if the next path exists.
-
previousPath
public boolean previousPath()Moves the iterator to the previous path. Returns the TRUE if successful.- Returns:
- TRUE if the previous path exists.
-
resetToFirstPath
public void resetToFirstPath()Resets the iterator such that a subsequent call to NextPath will set the iterator to the first path. -
resetToLastPath
public void resetToLastPath()Resets the iterator such that a subsequent call to PreviousPath will set the iterator to the last path. -
resetToPath
public void resetToPath(int pathIndex) Resets the iterator such that a subsequent call to NextPath will set the iterator to the given path index. A call to PreviousPath will set the iterator to the path at pathIndex - 1. -
isFirstSegmentInPath
public boolean isFirstSegmentInPath()Indicates whether the iterator points to the first segment in the current path.- Returns:
- TRUE if the iterator points to the first segment in the current path.
-
isLastSegmentInPath
public boolean isLastSegmentInPath()Indicates whether the iterator points to the last segment in the current path.- Returns:
- TRUE if the iterator points to the last segment in the current path.
-
resetToFirstSegment
public void resetToFirstSegment()Resets the iterator so that the call to NextSegment will return the first segment of the current path. -
resetToLastSegment
public void resetToLastSegment()Resets the iterator so that the call to PreviousSegment will return the last segment of the current path. -
resetToVertex
public void resetToVertex(int vertexIndex, int pathIndex) Resets the iterator to a specific vertex. The call to next_segment will return the segment that starts at the vertex. Call to previous_segment will return the segment that starts at the previous vertex.- Parameters:
vertexIndex
- The vertex index to reset the iterator to.pathIndex
- The path index to reset the iterator to. Used as a hint. If the path_index is wrong or -1, then the path_index is automatically calculated.
-
hasNextSegment
public boolean hasNextSegment()Indicates whether a next segment exists for the path.- Returns:
- TRUE is the next segment exists.
-
hasPreviousSegment
public boolean hasPreviousSegment()Indicates whether a previous segment exists in the path.- Returns:
- TRUE if the previous segment exists.
-
nextSegment
Moves the iterator to the next segment and returns the segment. The Segment is returned by value and is owned by the iterator. -
previousSegment
Moves the iterator to previous segment and returns the segment. The Segment is returned by value and is owned by the iterator. -
getPathIndex
public int getPathIndex()Returns the index of the current path. -
getStartPointIndex
public int getStartPointIndex()Returns the index of the start point of this segment. -
getEndPointIndex
public int getEndPointIndex()Returns the index of the end point of the current segment. -
isClosingSegment
public boolean isClosingSegment()Returns TRUE, if the segment is the closing segment of the closed path -
setCirculator
public void setCirculator(boolean bYesNo) Switches the iterator to navigation mode.- Parameters:
bYesNo
- If TRUE, the iterator loops over the current path infinitely (unless the multipath is empty).
-
copy
Copies this SegmentIterator.- Returns:
- SegmentIterator.
-
_getImpl
-