Package org.locationtech.jts.noding
Class BasicSegmentString
java.lang.Object
org.locationtech.jts.noding.BasicSegmentString
- All Implemented Interfaces:
SegmentString
Represents a list of contiguous line segments,
and supports noding the segments.
The line segments are represented by an array of
Coordinate
s.
Intended to optimize the noding of contiguous segments by
reducing the number of allocated objects.
SegmentStrings can carry a context object, which is useful
for preserving topological or parentage information.
All noded substrings are initialized with the same context object.- Version:
- 1.7
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBasicSegmentString
(Coordinate[] pts, Object data) Creates a new segment string from a list of vertices. -
Method Summary
Modifier and TypeMethodDescriptiongetCoordinate
(int i) getData()
Gets the user-defined data for this segment string.int
getSegmentOctant
(int index) Gets the octant of the segment starting at vertexindex
.boolean
isClosed()
void
Sets the user-defined data for this segment string.int
size()
toString()
-
Field Details
-
pts
-
data
-
-
Constructor Details
-
BasicSegmentString
Creates a new segment string from a list of vertices.- Parameters:
pts
- the vertices of the segment stringdata
- the user-defined data of this segment string (may be null)
-
-
Method Details
-
getData
Gets the user-defined data for this segment string.- Specified by:
getData
in interfaceSegmentString
- Returns:
- the user-defined data
-
setData
Sets the user-defined data for this segment string.- Specified by:
setData
in interfaceSegmentString
- Parameters:
data
- an Object containing user-defined data
-
size
public int size()- Specified by:
size
in interfaceSegmentString
-
getCoordinate
- Specified by:
getCoordinate
in interfaceSegmentString
-
getCoordinates
- Specified by:
getCoordinates
in interfaceSegmentString
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceSegmentString
-
getSegmentOctant
public int getSegmentOctant(int index) Gets the octant of the segment starting at vertexindex
.- Parameters:
index
- the index of the vertex starting the segment. Must not be the last index in the vertex list- Returns:
- the octant of the segment at the vertex
-
toString
-