Class Segment
- java.lang.Object
- 
- com.esri.arcgisruntime.geometry.Segment
 
- 
- Direct Known Subclasses:
- CubicBezierSegment,- EllipticArcSegment,- LineSegment
 
 public abstract class Segment extends java.lang.ObjectA 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. The ArcGIS Platform, including ArcGIS Runtime, supports both linear segments (represented by LineSegment) and curve segments,(represented byCubicBezierSegmentandEllipticArcSegment).GeometryEngine.densify(Geometry, double)can translate curve segments into multipleLineSegmentinstances to approximate the curve.Every ImmutablePartin aMultipartgeometry is a collection ofSegmentinstances, where the end of one segment is at exactly the same location as the start of the following segment.Multipartgeometries can be composed from and decomposed into their constituent segments if required.Because a single location is shared by adjacent segments, a single Pointobject 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 or polygon, there will be one more point than the number of segments in that same part.Segments are immutable so you can not change a segment's shape once it is created. For workflows that involve geometry editing, create a new segment with the properties you require. From v100.12, curve segments are supported in geometry editing workflows. You can add curve segments to a MultipartBuilder, and if a geometry has curves (Geometry.hasCurves()is true) then curve segments will be returned where applicable from theImmutablePartcollections that comprise the multipart geometry. Curve and linear segments can be mixed together in the same geometry.Like the geometries they comprise, a Segmentis immutable.- Since:
- 100.0.0
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description PointgetEndPoint()Gets a Point representing the end of this Segment.SpatialReferencegetSpatialReference()Gets the SpatialReference of this Segment.PointgetStartPoint()Gets a Point representing the start of this Segment.booleanisClosed()Indicates if this segment is closed, that is it has a matching start and end point.booleanisCurve()Indicates if this Segment is curved.
 
- 
- 
- 
Method Detail- 
getStartPointpublic Point getStartPoint() Gets a Point representing the start of this Segment.- Returns:
- the start point
- Since:
- 100.0.0
 
 - 
getEndPointpublic Point getEndPoint() Gets a Point representing the end of this Segment.- Returns:
- the end point
- Since:
- 100.0.0
 
 - 
getSpatialReferencepublic SpatialReference getSpatialReference() Gets the SpatialReference of this Segment.- Returns:
- the SpatialReference of this Segment.
- Since:
- 100.0.0
 
 - 
isCurvepublic boolean isCurve() Indicates if this Segment is curved. Prior to v100.12, onlyLineSegmentinstances were supported when creating new geometries using aMultipartBuilderor iterating theSegmentinstances in an existingMultipartgeometry.From v100.12, you can add curve segments when using a MultipartBuilder, and get them back from an existingMultipartgeometry whenGeometry.hasCurves()is true.- Returns:
- false if the object is a LineSegment; true otherwise
- Since:
- 100.10.0
- See Also:
- GeometryBuilder.hasCurves(),- Part.hasCurves(),- CubicBezierSegment,- EllipticArcSegment
 
 - 
isClosedpublic 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
 
 
- 
 
-