Class Part
 java.lang.Object

 java.util.AbstractCollection<E>

 java.util.AbstractList<Segment>

 com.esri.arcgisruntime.geometry.Part

public final class Part extends AbstractList<Segment>
Represents a mutable collection ofSegments
that define the shape of a part of aMultipart
geometry under construction. Used inPolygon
andPolyline
constructors, and byMultipartBuilder.getParts()
. Use the methods inherited from the generic JavaAbstractList<T>
class to define and change the shape of the geometry by adding, removing, or changing itsSegments
. Additionally, theaddPoint
,addPoints
,setPoint
, andremovePoint
Point
based helper methods allow working with Points that represent the vertices of the Part, instead of working with Segments.The SpatialReference of any geometries added to a Part must match that of the Part, or be null (in which case the geometry is assumed to have the same SpatialReference as the Part). Added geometries are not reprojected.
Parts can then be added to, inserted into, and removed from
PartCollections
, in order to build up the complete shape of a geometry with multiple parts. Again, the SpatialReferences must be compatible.For more information about building geometries, see the 'Fundamentals' > 'Geometries' topic in the Guide.
 Since:
 100.0.0


Field Summary

Fields inherited from class java.util.AbstractList
modCount


Constructor Summary
Constructors Constructor Description Part(ImmutablePointCollection points)
Creates a new part from the given ImmutablePointCollection.Part(ImmutablePointCollection points, SpatialReference spatialReference)
Creates a new part from the given ImmutablePointCollection and SpatialReference.Part(PointCollection points)
Creates a new part from the given PointCollection.Part(PointCollection points, SpatialReference spatialReference)
Creates a new part from the given PointCollection and SpatialReference.Part(SpatialReference spatialReference)
Creates a new empty Part with the given SpatialReference.Part(Iterable<Segment> segments)
Creates a new part with the given set of Segments.Part(Iterable<Segment> segments, SpatialReference spatialReference)
Creates a new part with the given set of Segments and SpatialReference.

Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, Segment segment)
Inserts the given Segment at the given index position in this Part.boolean
add(Segment segment)
Appends the given Segment to the end of this Part.void
addAllPoints(int index, Collection<? extends Point> points)
Inserts the given collection of Points at the given index position in this Part.void
addPoint(double x, double y)
Creates a new Point from the given x,y coordinates and appends it to the end of this Part, resulting in a new LineSegment between the previous last Point and the appended Point.void
addPoint(double x, double y, double z)
Creates a new Point from the given x,y coordinates and z value, and appends it to the end of this Part, resulting in a new LineSegment between the previous last Point and the appended Point.void
addPoint(int index, double x, double y)
Creates a new Point from the given x,y coordinates and inserts it at the given index position in this Part, by replacing an existing Segment with two new LineSegments.void
addPoint(int index, double x, double y, double z)
Creates a new Point from the given x,y coordinates and z value, and inserts it at the given index position in this Part, by replacing an existing Segment with two new LineSegments.void
addPoint(int index, Point point)
Inserts the given Point at the given index position in this Part, by replacing an existing Segment with two new LineSegments.void
addPoint(Point point)
Appends the given Point to the end of this Part, resulting in a new LineSegment between the previous last Point and the appended Point.void
addPoints(Collection<? extends Point> points)
Appends the given collection of Points to the end of this Part, resulting in new LineSegments between the previous last Point and each appended Point.void
clear()
Removes all Segments from the Part.boolean
contains(Object o)
Segment
get(int index)
Gets a copy of theSegment
at the given index position in this Part.Point
getEndPoint()
Gets a copy of a Point representing the end of the last Segment of the Part.int
getEndPointIndexFromSegmentIndex(int segmentIndex)
Gets the index of the end point of a segment.Point
getPoint(int index)
Gets a copy of the Point at the given index in the Part.int
getPointCount()
Returns the number of Points in the Part, representing the number of vertices in the shape.Iterable<Point>
getPoints()
Gets an iterator of Points representing the ends of the Segments in this Part (the vertices in the shape).int
getSegmentIndexFromEndPointIndex(int endPointIndex)
Gets the index of the segment that has a given end point.int
getSegmentIndexFromStartPointIndex(int startPointIndex)
Gets the index of the segment that has a given start point.SpatialReference
getSpatialReference()
Gets the SpatialReference of the geometries in this Part.Point
getStartPoint()
Gets a copy of a Point representing the start of the first Segment of the Part.int
getStartPointIndexFromSegmentIndex(int segmentIndex)
Gets the index of the start point of a segment.boolean
hasCurves()
Indicates if this Part contains Segments that represent true curves.int
indexOf(Object o)
boolean
isEmpty()
Segment
remove(int index)
Removes the Segment at the specified index position from this Part.boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
Point
removePoint(int index)
Removes the Point at the given index position from the Part.boolean
retainAll(Collection<?> c)
Segment
set(int index, Segment segment)
Replaces the Segment at the given index position with the given Segment.void
setPoint(int index, Point point)
Sets the given Point at the given point index position in this Part.int
size()
Returns the number ofSegments
in this Part.
Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList

Methods inherited from class java.util.AbstractCollection
addAll, containsAll, toArray, toArray, toString

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray

Methods inherited from interface java.util.List
addAll, containsAll, replaceAll, sort, spliterator, toArray, toArray




Constructor Detail

Part
public Part(SpatialReference spatialReference)
Creates a new empty Part with the given SpatialReference. SpatialReference cannot be changed after instantiation. Parameters:
spatialReference
 the SpatialReference of the new Part. May be null. Since:
 100.0.0

Part
public Part(Iterable<Segment> segments)
Creates a new part with the given set of Segments. The Segments in the part can be modified after instantiation. The SpatialReference of the new Part will match that of the given segments. Parameters:
segments
 the set of Segments that this Part will be initialized with. For example, this argument may be an existingPart
,ImmutablePart
, or standard generic Java ArrayList containing Segments. If null, an empty Part is created. Throws:
ArcGISRuntimeException
 ifsegments
contains Segments that have differing SpatialReferences set. Since:
 100.0.0

Part
public Part(Iterable<Segment> segments, SpatialReference spatialReference)
Creates a new part with the given set of Segments and SpatialReference. The Segments in the part can be modified after instantiation.Use this constructor to create a new Part with a specific SpatialReference from an existing set of segments that have null SpatialReferences (the segments are assigned the given SpatialReferencethey are not projected). Can also be used where the SpatialReference of some segments matches that of the argument, but is null for other segments.
 Parameters:
segments
 the set of Segments that this Part will be initialized with. For example, this argument may be an existingPart
,ImmutablePart
, or standard generic JavaArrayList
containing Segments. If null, an empty Part is created.spatialReference
 the SpatialReference of the new Part. May be null. Throws:
ArcGISRuntimeException
 if thesegments
argument contains Segments with SpatialReferences that do not match thespatialReference
argument. Since:
 100.0.0

Part
public Part(PointCollection points)
Creates a new part from the given PointCollection. The part can be modified after instantiation. The SpatialReference of the new Part will match that of the given points. Parameters:
points
 the set of Points that this Part will be initialized with. If null, an empty Part is created. Since:
 100.0.0

Part
public Part(PointCollection points, SpatialReference spatialReference)
Creates a new part from the given PointCollection and SpatialReference. The part can be modified after instantiation.Use this constructor to create a new Part with a specific SpatialReference from an existing PointCollection that has a null SpatialReference (the points are assigned the given SpatialReferencethey are not projected).
 Parameters:
points
 the set of Points that this Part will be initialized with. If null, an empty Part is created.spatialReference
 the SpatialReference of the new Part. May be null. Throws:
ArcGISRuntimeException
 if thepoints
argument contains Points with SpatialReferences that do not match thespatialReference
argument. Since:
 100.0.0

Part
public Part(ImmutablePointCollection points)
Creates a new part from the given ImmutablePointCollection. The part can be modified after instantiation. The SpatialReference of the new Part will match that of the given points.Use this constructor to create a new Part from a Part of an existing Polygon or Polyline by using
ImmutablePart.getPoints()
. Parameters:
points
 the set of Points that this Part will be initialized with Since:
 100.0.0

Part
public Part(ImmutablePointCollection points, SpatialReference spatialReference)
Creates a new part from the given ImmutablePointCollection and SpatialReference. The part can be modified after instantiation.Use this constructor to create a new Part with a specific SpatialReference from an existing ImmutablePointCollection that has a null SpatialReference (the points are assigned the given SpatialReferencethey are not projected). An example of this is to create a new Part from a Part of an existing Polygon or Polyline by using
ImmutablePart.getPoints()
. Parameters:
points
 the set of Points that this Part will be initialized with. If null, an empty Part is created.spatialReference
 spatialReference the SpatialReference of the new Part. May be null. Since:
 100.0.0


Method Detail

getSpatialReference
public SpatialReference getSpatialReference()
Gets the SpatialReference of the geometries in this Part. TheSpatialReference
defines how coordinates correspond to locations in the real world. This is set during instantiation and cannot be changed. May be null. Returns:
 the SpatialReference of the geometries in this Part
 Since:
 100.0.0

isEmpty
public boolean isEmpty()
 Specified by:
isEmpty
in interfaceCollection<Segment>
 Specified by:
isEmpty
in interfaceList<Segment>
 Overrides:
isEmpty
in classAbstractCollection<Segment>

contains
public boolean contains(Object o)
 Specified by:
contains
in interfaceCollection<Segment>
 Specified by:
contains
in interfaceList<Segment>
 Overrides:
contains
in classAbstractCollection<Segment>

get
public Segment get(int index)
Gets a copy of theSegment
at the given index position in this Part. Specified by:
get
in interfaceList<Segment>
 Specified by:
get
in classAbstractList<Segment>
 Parameters:
index
 the index of the Segment to copy Returns:
 a copy of the Segment at the given index
 Throws:
IndexOutOfBoundsException
 ifindex < 0  index >= size()
 Since:
 100.0.0

size
public int size()
Returns the number ofSegments
in this Part. Use this to find the maximum index for callingget(int)
.A Part can also be represented by a set of Points representing each vertex; the getPointCount method returns the number of Points in the Part. See
getPointCount()
for an explanation of how the two relate. Specified by:
size
in interfaceCollection<Segment>
 Specified by:
size
in interfaceList<Segment>
 Specified by:
size
in classAbstractCollection<Segment>
 Since:
 100.0.0
 See Also:
getPointCount()
,get(int)

indexOf
public int indexOf(Object o)

set
public Segment set(int index, Segment segment)
Replaces the Segment at the given index position with the given Segment.Use this method to update a segment in a Part  as segments are immutable, properties of existing segments cannot be changed.
 Specified by:
set
in interfaceList<Segment>
 Overrides:
set
in classAbstractList<Segment>
 Parameters:
index
 the index of the Segment to replacesegment
 the Segment to set at the given index Throws:
IndexOutOfBoundsException
 ifindex
< 0 index
>= size()NullPointerException
 ifsegment
is nullArcGISRuntimeException
 if thesegment
has a SpatialReference that does not match that of this Part. The SpatialReference of thesegment
may however be null. Since:
 100.0.0
 See Also:
add(int, Segment)

add
public boolean add(Segment segment)
Appends the given Segment to the end of this Part.If the
start point
of the appended Segment is at a different location to theend point
of the previous Segment, a gap will be introduced to the Part. Any gaps will be replaced by new connecting segments in the return value ofGeometryBuilder.toGeometry()
. Alternatively, use theaddPoint(Point)
method to add a Point to the Part. Specified by:
add
in interfaceCollection<Segment>
 Specified by:
add
in interfaceList<Segment>
 Overrides:
add
in classAbstractList<Segment>
 Parameters:
segment
 the Segment to append to this PointCollection Returns:
 always true
 Throws:
NullPointerException
 ifsegment
is nullArcGISRuntimeException
 if thesegment
has a SpatialReference that does not match that of this Part. The SpatialReference of thesegment
may however be null. Since:
 100.0.0
 See Also:
addPoint(Point)
,add(int, Segment)

add
public void add(int index, Segment segment)
Inserts the given Segment at the given index position in this Part. The index positions of all existing Segments at that index or greater increase by one.If the
start point
and/orend point
of the inserted Segment is at a different location to those of the adjacent Segments, gap(s) will be introduced to the Part. Any gaps will be replaced by new connecting segments in the return value ofGeometryBuilder.toGeometry()
. Alternatively, use theaddPoint(int, Point)
method to insert a Point in the Part. Specified by:
add
in interfaceList<Segment>
 Overrides:
add
in classAbstractList<Segment>
 Parameters:
index
 the index of the Segment to insert in the Partsegment
 the Segment to insert at the given index Throws:
NullPointerException
 ifsegment
is nullArcGISRuntimeException
 if thesegment
has a SpatialReference that does not match that of this Part. The SpatialReference of thesegment
may however be null.IndexOutOfBoundsException
 ifindex
< 0 index
> size() Since:
 100.0.0
 See Also:
add(Segment)

remove
public Segment remove(int index)
Removes the Segment at the specified index position from this Part. No other segments are changed when this method is called, which may result in a gap between the segment ends. Specified by:
remove
in interfaceList<Segment>
 Overrides:
remove
in classAbstractList<Segment>
 Parameters:
index
 the index of the Segment to remove Returns:
 a copy of the removed Segment
 Throws:
IndexOutOfBoundsException
 ifindex
< 0 index
>= size() Since:
 100.0.0
 See Also:
size()
,clear()

remove
public boolean remove(Object o)
 Specified by:
remove
in interfaceCollection<Segment>
 Specified by:
remove
in interfaceList<Segment>
 Overrides:
remove
in classAbstractCollection<Segment>

removeAll
public boolean removeAll(Collection<?> c)
 Specified by:
removeAll
in interfaceCollection<Segment>
 Specified by:
removeAll
in interfaceList<Segment>
 Overrides:
removeAll
in classAbstractCollection<Segment>

retainAll
public boolean retainAll(Collection<?> c)
 Specified by:
retainAll
in interfaceCollection<Segment>
 Specified by:
retainAll
in interfaceList<Segment>
 Overrides:
retainAll
in classAbstractCollection<Segment>

getPointCount
public int getPointCount()
Returns the number of Points in the Part, representing the number of vertices in the shape. Use this to find the maximum index for callinggetPoint(int)
.Typically this number is one greater than the number of Segments in the part (
size()
). Where two adjacent segments share a start and end location (there is no gap between the segments), this is represented by a single Point. If using pointbased methods to construct Parts, there will be no gaps between segments. However if using Segments to construct Parts, it is possible to introduce gaps between segments.Gaps are eliminated when geometries are built using the
GeometryBuilder.toGeometry()
method. Completed Multipart geometries do not have gaps between the segments of a part, but separate Parts may be disjoint. Returns:
 the number of Points in the Part
 Since:
 100.0.0
 See Also:
size()
,getPoints()

getStartPoint
public Point getStartPoint()
Gets a copy of a Point representing the start of the first Segment of the Part. This is a shortcut to getting the first Segment in the Part, then getting its start point usingSegment.getStartPoint()
, or getting the first Point in the Part usinggetPoint(int)
. Returns:
 a Point representing the start point
 Since:
 100.0.0
 See Also:
getEndPoint()

getEndPoint
public Point getEndPoint()
Gets a copy of a Point representing the end of the last Segment of the Part. This is a shortcut to getting the last Segment in the Part, then getting its end point usingSegment.getEndPoint()
, or getting the last Point in the Part usinggetPoint(int)
. Returns:
 a Point representing the end point
 Since:
 100.0.0
 See Also:
getStartPoint()

hasCurves
public boolean hasCurves()
Indicates if this Part contains Segments that represent true curves.The ArcGIS system supports polygon and polyline geometries that contain curved segments in some types of data, for example geodatabases, feature services, and JSON. At the current release this SDK can display curved geometries, but you cannot work with curves using the API; any curved segments in a geometry will be represented as
LineSegments
, and the curve information will be lost. In editing workflows, use this method to determine if this Part contains curve information which would be lost if used in an editing workflow. Returns:
 true if this Part contains curved segments; false otherwise
 Since:
 100.0.0

getPoints
public Iterable<Point> getPoints()
Gets an iterator of Points representing the ends of the Segments in this Part (the vertices in the shape).Where two adjacent segments share a start and end location (there is no gap between the segments), this is represented by a single Point. See
getPointCount()
for more information. Returns:
 an iterator of Points
 Since:
 100.0.0
 See Also:
PartCollection.getPartsAsPoints()

getPoint
public Point getPoint(int index)
Gets a copy of the Point at the given index in the Part. UsegetPointCount()
to determine the maximum possible index. Note that points are copied, and therefore returned byvalue.The vertices of a MultipartBuilder's current state can be represented as a series of Points, which can be accessed using this method, or by the
getPoints()
iterator. If the geometry containscurves
, that information cannot be represented by points; segmentbased methods such asget(int)
anditerator()
may be more appropriate instead. Note that at the current release, true curves are not supported. Parameters:
index
 the index of the Point to get Returns:
 a copy of the Point at the given index
 Throws:
IndexOutOfBoundsException
 ifindex
< 0 index
>= getPointCount() Since:
 100.0.0

addPoint
public void addPoint(Point point)
Appends the given Point to the end of this Part, resulting in a new LineSegment between the previous last Point and the appended Point. This is a common method to use when building Multipart shapes without curves, as it may be simpler than usingadd(Segment)
and creating Segments explicitly.Alternatives exist to append a new Point by specifying coordinates directly, using
addPoint(double, double)
) or similar overloads. Use theaddPoint(int, Point)
to insert a Point at a position other than the end of the Part. Parameters:
point
 the Point to append to this Part Throws:
NullPointerException
 ifpoint
is nullArcGISRuntimeException
 if thepoint
has a SpatialReference that does not match that of this Part. The SpatialReference of thepoint
may however be null. Since:
 100.0.0

addPoint
public void addPoint(double x, double y)
Creates a new Point from the given x,y coordinates and appends it to the end of this Part, resulting in a new LineSegment between the previous last Point and the appended Point. This is a common method to use when building Multipart shapes without curves, as it may be simpler than usingadd(Segment)
and creating Segments explicitly.The appended Point will have default z and m values, and will take on the spatial reference of the Part; therefore ensure that the
x
andy
parameters are defined in the spatial reference of this Part. If either x or y are NaN, the added Point will beempty
. Alternatively, append an existing Point object to a Part usingaddPoint(Point)
). Parameters:
x
 the x coordinate of the new Point added to the Party
 the y coordinate of the new Point added to the Part Since:
 100.0.0

addPoint
public void addPoint(double x, double y, double z)
Creates a new Point from the given x,y coordinates and z value, and appends it to the end of this Part, resulting in a new LineSegment between the previous last Point and the appended Point. This is a common method to use when building Multipart shapes without curves, as it may be simpler than usingadd(Segment)
and creating Segments explicitly.The appended Point will take on the spatial reference of the Part; therefore ensure that the
x
andy
parameters are defined in the spatial reference of this Part. Alternatively, append an existing Point object to a Part usingaddPoint(Point)
). Parameters:
x
 the x coordinate of the new Point added to the Party
 the y coordinate of the new Point added to the Partz
 the z value of the new Point added to the Part Since:
 100.0.0

addPoints
public void addPoints(Collection<? extends Point> points)
Appends the given collection of Points to the end of this Part, resulting in new LineSegments between the previous last Point and each appended Point. This is a common method to use when building Multipart shapes without curves, as it may be simpler than usingaddAll(Collection)
and creating Segments explicitly. Parameters:
points
 the collection of Points to append to the end of this Part Throws:
NullPointerException
 ifpoints
is nullArcGISRuntimeException
 if thepoints
have a SpatialReference that does not match that of this Part. The SpatialReference of thepoints
may however be null. Since:
 100.0.0

addPoint
public void addPoint(int index, Point point)
Inserts the given Point at the given index position in this Part, by replacing an existing Segment with two new LineSegments. The index positions of all subsequent Segments (and Points) increase by one. Gaps between adjacent segments cannot be introduced by pointbased methods, but existing gaps may be maintained; if affected segments already have a gap.Alternatively, use the
addPoint(Point)
method to append a Point to the end of the Part. Parameters:
index
 the index of the Point to insert in the Partpoint
 the Point to insert at the given index Throws:
NullPointerException
 ifpoint
is nullArcGISRuntimeException
 if thepoint
has a SpatialReference that does not match that of this Part. The SpatialReference of thepoint
may however be null.IndexOutOfBoundsException
 ifindex
< 0 index
> getPointCount() Since:
 100.0.0
 See Also:
add(int, Segment)

addPoint
public void addPoint(int index, double x, double y)
Creates a new Point from the given x,y coordinates and inserts it at the given index position in this Part, by replacing an existing Segment with two new LineSegments. The index positions of all subsequent Segments (and Points) increase by one. Gaps between adjacent segments cannot be introduced by pointbased methods, but existing gaps may be maintained; if affected segments already have a gap. Parameters:
index
 the index of the Point to insert in the Partx
 the x coordinate of the new Point inserted into the Party
 the y coordinate of the new Point inserted into the Part Throws:
IndexOutOfBoundsException
 ifindex
< 0 index
> getPointCount() Since:
 100.0.0

addPoint
public void addPoint(int index, double x, double y, double z)
Creates a new Point from the given x,y coordinates and z value, and inserts it at the given index position in this Part, by replacing an existing Segment with two new LineSegments. The index positions of all subsequent Segments (and Points) increase by one. Gaps between adjacent segments cannot be introduced by pointbased methods, but existing gaps may be maintained; if affected segments already have a gap. Parameters:
index
 the index of the Point to insert in the Partx
 the x coordinate of the new Point inserted into the Party
 the y coordinate of the new Point inserted into the Partz
 the z value of the new Point inserted into the Part Throws:
IndexOutOfBoundsException
 ifindex
< 0 index
> getPointCount() Since:
 100.0.0

addAllPoints
public void addAllPoints(int index, Collection<? extends Point> points)
Inserts the given collection of Points at the given index position in this Part. Up to two existing Segments may be removed and replaced by new LineSegments connecting to the new Points; additionally new LineSegments are created between each inserted Point. This is a common method to use when building Multipart shapes without curves, as it may be simpler than usingaddAll(int, Collection)
and creating Segments explicitly. Parameters:
index
 the index position at which to begin inserting the points into the Partpoints
 the collection of Points to insert at the given position Throws:
NullPointerException
 ifpoints
is nullArcGISRuntimeException
 if any Point inpoints
has a SpatialReference that does not match that of this Part. The SpatialReference of a Point may however be null.IndexOutOfBoundsException
 ifindex
< 0 index
> getPointCount() Since:
 100.0.0

setPoint
public void setPoint(int index, Point point)
Sets the given Point at the given point index position in this Part. This replaces the Point previously at that position and updates the segments that use it. Parameters:
index
 the index position within the Part at which to set the Pointpoint
 the Point to set Throws:
IndexOutOfBoundsException
 ifindex
< 0 index
>= getPointCount()IllegalArgumentException
 if point is null Since:
 100.3.0

removePoint
public Point removePoint(int index)
Removes the Point at the given index position from the Part. The two existing Segments that start and end at this Point are removed, and replaced by a new LineSegment that connects the adjacent Points.This is a common method to use when editing Multipart shapes without curves, as it may be simpler than working with Segments and using
remove(int)
. Parameters:
index
 the index of the Point to remove from the Part Returns:
 a copy of the removed Point
 Throws:
IndexOutOfBoundsException
 ifindex
< 0 index
>= getPointCount() Since:
 100.0.0

getSegmentIndexFromStartPointIndex
public int getSegmentIndexFromStartPointIndex(int startPointIndex)
Gets the index of the segment that has a given start point. Parameters:
startPointIndex
 the 0based index of the start point Returns:
 the index of the segment, or 1 if startPointIndex does not correspond to a segment start point
 Throws:
IndexOutOfBoundsException
 if startPointIndex is out of bounds Since:
 100.1.0

getSegmentIndexFromEndPointIndex
public int getSegmentIndexFromEndPointIndex(int endPointIndex)
Gets the index of the segment that has a given end point. Parameters:
endPointIndex
 the 0based index of the end point Returns:
 the index of the segment, or 1 if endPointIndex does not correspond to a segment end point
 Throws:
IndexOutOfBoundsException
 if endPointIndex is out of bounds Since:
 100.1.0

getStartPointIndexFromSegmentIndex
public int getStartPointIndexFromSegmentIndex(int segmentIndex)
Gets the index of the start point of a segment. Parameters:
segmentIndex
 the 0based index of the segment Returns:
 the index of the start point
 Throws:
IndexOutOfBoundsException
 if segmentIndex is out of bounds Since:
 100.1.0

getEndPointIndexFromSegmentIndex
public int getEndPointIndexFromSegmentIndex(int segmentIndex)
Gets the index of the end point of a segment. Parameters:
segmentIndex
 the 0based index of the segment Returns:
 the index of the end point
 Throws:
IndexOutOfBoundsException
 if segmentIndex is out of bounds Since:
 100.1.0

clear
public void clear()
Removes all Segments from the Part. Using this method is more efficient than removing all Segments individually.After calling this method, the Part will have a
size()
of zero. It will also have agetPointCount()
of zero because the Points in a Part represent the ends of its current Segments. Specified by:
clear
in interfaceCollection<Segment>
 Specified by:
clear
in interfaceList<Segment>
 Overrides:
clear
in classAbstractList<Segment>
 Since:
 100.0.0
 See Also:
isEmpty()

