Package com.luciad.geometries
Class Polygon
java.lang.Object
com.luciad.geometries.Geometry
com.luciad.geometries.Surface
com.luciad.geometries.CompositePatch
com.luciad.geometries.Polygon
- All Implemented Interfaces:
AutoCloseable
Represents a polygon.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionappendInteriorRing
(PolylineRing interiorRing) Creates a newPolygon
instance based on this instance, but with a new interior ring appended to the list of interior rings.void
close()
protected void
finalize()
removeInteriorRing
(long index) Creates a newPolygon
instance based on this instance, but with the interior ring at location 'index' removed.replaceExteriorRing
(PolylineRing exteriorRing) Creates a newPolygon
instance using the interior rings from this instance, but with a new exterior ring.replaceInteriorRing
(long index, PolylineRing interiorRing) Creates a newPolygon
instance with the exterior and interior rings from this instance, but with a new interior ring at location 'index'.Methods inherited from class com.luciad.geometries.CompositePatch
getExteriorPatch, getInteriorPatches
Methods inherited from class com.luciad.geometries.Geometry
getBounds, getReference
-
Method Details
-
finalize
protected void finalize()- Overrides:
finalize
in classCompositePatch
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classCompositePatch
-
replaceExteriorRing
@NotNull public Polygon replaceExteriorRing(@NotNull PolylineRing exteriorRing) throws NullPointerException Creates a newPolygon
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 passingnull
.- Since:
- 2024.1
-
replaceInteriorRing
@NotNull public Polygon replaceInteriorRing(long index, @NotNull PolylineRing interiorRing) throws NullPointerException, IllegalArgumentException Creates a newPolygon
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 replaceinteriorRing
- the new interior ring.- Returns:
- a new
Polyline
instance - Throws:
NullPointerException
- when passingnull
.IllegalArgumentException
- for an invalid index- Since:
- 2024.1
-
appendInteriorRing
@NotNull public Polygon appendInteriorRing(@NotNull PolylineRing interiorRing) throws NullPointerException Creates a newPolygon
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 passingnull
.- Since:
- 2024.1
-
removeInteriorRing
Creates a newPolygon
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
-