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 Type
    Method
    Description
    Gets the segment string coordinate at a given index.
    Gets the coordinates in this segment string.
    Gets the user-defined data for this segment string.
    boolean
    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
    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

      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:
      index - the vertex index
      ringSS - a segment string forming a ring
      Returns:
      the previous vertex in the ring
      See Also:
    • nextInRing

      default Coordinate nextInRing(int index)
      Gets the next vertex in a ring from a vertex index.
      Parameters:
      index - the vertex index
      ringSS - a segment string forming a ring
      Returns:
      the next vertex in the ring
      See Also: