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.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.voidSets the user-defined data for this segment string.intsize()Gets the number of coordinates in this segment string.
-
Method Details
-
getData
-
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:
-