Package org.locationtech.jts.noding
Interface SegmentString
- All Known Subinterfaces:
NodableSegmentString
- All Known Implementing Classes:
BasicSegmentString
,NodedSegmentString
public interface SegmentString
An interface for classes which represent a sequence of contiguous line segments.
SegmentStrings can carry a context object, which is useful
for preserving topological or parentage information.
- Version:
- 1.7
-
Method Summary
Modifier and TypeMethodDescriptiongetCoordinate
(int i) Gets the segment string coordinate at a given index.Gets the coordinates in this segment string.getData()
Gets the user-defined data for this segment string.boolean
isClosed()
Tests if a segment string is a closed ring.default Coordinate
nextInRing
(int index) Gets the next vertex in a ring from a vertex index.default Coordinate
prevInRing
(int index) Gets the previous vertex in a ring from a vertex index.void
Sets the user-defined data for this segment string.int
size()
Gets the number of coordinates in this segment string.
-
Method Details
-
getData
Object getData()Gets the user-defined data for this segment string.- Returns:
- the user-defined data
-
setData
Sets the user-defined data for this segment string.- Parameters:
data
- an Object containing user-defined data
-
size
int size()Gets the number of coordinates in this segment string.- Returns:
- the number of coordinates
-
getCoordinate
Gets the segment string coordinate at a given index.- Parameters:
i
- the coordinate index- Returns:
- the coordinate at the index
-
getCoordinates
Coordinate[] getCoordinates()Gets the coordinates in this segment string.- Returns:
- the coordinates as an array
-
isClosed
boolean isClosed()Tests if a segment string is a closed ring.- Returns:
- true if the segment string is closed
-
prevInRing
Gets the previous vertex in a ring from a vertex index.- Parameters:
index
- the vertex indexringSS
- a segment string forming a ring- Returns:
- the previous vertex in the ring
- See Also:
-
nextInRing
Gets the next vertex in a ring from a vertex index.- Parameters:
index
- the vertex indexringSS
- a segment string forming a ring- Returns:
- the next vertex in the ring
- See Also:
-