Package org.locationtech.jts.noding
Interface SegmentString
-
- All Known Subinterfaces:
NodableSegmentString
- All Known Implementing Classes:
BasicSegmentString,NodedSegmentString
public interface SegmentStringAn 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 CoordinategetCoordinate(int i)Gets the segment string coordinate at a given index.Coordinate[]getCoordinates()Gets the coordinates in this segment string.ObjectgetData()Gets the user-defined data for this segment string.booleanisClosed()Tests if a segment string is a closed ring.default CoordinatenextInRing(int index)Gets the next vertex in a ring from a vertex index.default CoordinateprevInRing(int index)Gets the previous vertex in a ring from a vertex index.voidsetData(Object data)Sets the user-defined data for this segment string.intsize()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()
-
-