Class Polygon

All Implemented Interfaces:
AutoCloseable

public final class Polygon extends CompositePatch implements AutoCloseable
Represents a polygon.
See Also:
  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class CompositePatch
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class CompositePatch
    • replaceExteriorRing Link icon

      @NotNull public Polygon replaceExteriorRing(@NotNull PolylineRing exteriorRing) throws NullPointerException
      Creates a new Polygon instance using the interior rings from this instance, but with a new exterior ring.
      Parameters:
      exteriorRing - the new exterior ring.
      Returns:
      a new Polyline instance.
      Throws:
      NullPointerException - when passing null.
      Since:
      2024.1
    • replaceInteriorRing Link icon

      @NotNull public Polygon replaceInteriorRing(long index, @NotNull PolylineRing interiorRing) throws NullPointerException, IllegalArgumentException
      Creates a new Polygon instance with the exterior and interior rings from this instance, but with a new interior ring at location 'index'.
      Parameters:
      index - the index of the interior ring to replace
      interiorRing - the new interior ring.
      Returns:
      a new Polyline instance
      Throws:
      NullPointerException - when passing null.
      IllegalArgumentException - for an invalid index
      Since:
      2024.1
    • appendInteriorRing Link icon

      @NotNull public Polygon appendInteriorRing(@NotNull PolylineRing interiorRing) throws NullPointerException
      Creates a new Polygon instance based on this instance, but with a new interior ring appended to the list of interior rings.
      Parameters:
      interiorRing - the new interior ring.
      Returns:
      a new Polyline instance, with a new interior ring.
      Throws:
      NullPointerException - when passing null.
      Since:
      2024.1
    • removeInteriorRing Link icon

      @NotNull public Polygon removeInteriorRing(long index) throws IllegalArgumentException
      Creates a new Polygon instance based on this instance, but with the interior ring at location 'index' removed.
      Parameters:
      index - the index of the interior ring to remove
      Returns:
      a new Polyline instance, with the interior ring at location 'index' removed.
      Throws:
      IllegalArgumentException - for an invalid index
      Since:
      2024.1