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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Coordinate
getCoordinate(int i)
Gets the segment string coordinate at a given index.Coordinate[]
getCoordinates()
Gets the coordinates in this segment string.Object
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
setData(Object data)
Sets the user-defined data for this segment string.int
size()
Gets the number of coordinates in this segment string.
-
-
-
Method Detail
-
getData
Object getData()
Gets the user-defined data for this segment string.- Returns:
- the user-defined data
-
setData
void setData(Object data)
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
Coordinate getCoordinate(int i)
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
default Coordinate prevInRing(int index)
Gets the previous vertex in a ring from a vertex index.- Parameters:
ringSS
- a segment string forming a ringindex
- the vertex index- Returns:
- the previous vertex in the ring
- See Also:
isClosed()
-
nextInRing
default Coordinate nextInRing(int index)
Gets the next vertex in a ring from a vertex index.- Parameters:
ringSS
- a segment string forming a ringindex
- the vertex index- Returns:
- the next vertex in the ring
- See Also:
isClosed()
-
-