Class Segment

  • Direct Known Subclasses:
    LineSegment

    public abstract class Segment
    extends java.lang.Object
    A segment represents an edge of a multipart geometry, connecting a start to an end point.

    A Segment describes a continuous line between a start location and an end location. Every part in a Multipart geometry is a collection of segments where the end of one segment is at exactly the same location as the start of the following segment. The ArcGIS platform supports both straight and curved segments, but ArcGIS Runtime only supports LineSegment at the current release. Multipart geometries can be composed from and decomposed into segments if required; until true curves are supported fully, using point-based methods offers equivalent functionality.

    Because a single location is shared by adjacent segments, a single Point object is used to represent the shared location when you iterate through the points in a part. As a result, when iterating through the points in a part of a Polyline, there will be one more Point than the number of segments in that same part. Segments are used as the building blocks of the parts of Polygon and Polyline classes.

    Like the geometries they comprise, a Segment is immutable.

    Since:
    100.0.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Point getEndPoint()
      Gets a Point representing the end of this Segment.
      SpatialReference getSpatialReference()
      Gets the SpatialReference of this Segment.
      Point getStartPoint()
      Gets a Point representing the start of this Segment.
      boolean isClosed()
      Indicates if this segment is closed, that is it has a matching start and end point.
      boolean isCurve()
      Indicates if this Segment is curved.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getStartPoint

        public Point getStartPoint()
        Gets a Point representing the start of this Segment.
        Returns:
        the start point
        Since:
        100.0.0
      • getEndPoint

        public Point getEndPoint()
        Gets a Point representing the end of this Segment.
        Returns:
        the end point
        Since:
        100.0.0
      • getSpatialReference

        public SpatialReference getSpatialReference()
        Gets the SpatialReference of this Segment.
        Returns:
        the SpatialReference of this Segment.
        Since:
        100.0.0
      • isCurve

        public boolean isCurve()
        Indicates if this Segment is curved.

        Currently this method always returns false, as the only type of Segment currently available is a LineSegment, which cannot represent curves.

        Returns:
        true if this Segment is curved, false otherwise
        Since:
        100.0.0
      • isClosed

        public boolean isClosed()
        Indicates if this segment is closed, that is it has a matching start and end point.
        Returns:
        true if the segment is closed, false otherwise
        Since:
        100.0.0