Package net.pl3x.map.core.markers.marker
Class MultiPolygon
java.lang.Object
net.pl3x.map.core.Keyed
net.pl3x.map.core.markers.marker.Marker<@NotNull MultiPolygon>
net.pl3x.map.core.markers.marker.MultiPolygon
- All Implemented Interfaces:
JsonSerializable
Represents a multi-polygon marker.
-
Constructor Summary
ConstructorDescriptionMultiPolygon
(@NotNull String key, @NotNull Collection<@NotNull Polygon> polygons) Create a new multi-polygon.MultiPolygon
(@NotNull String key, @NotNull Polygon polygon) Create a new multi-polygon.MultiPolygon
(@NotNull String key, @NotNull Polygon @NotNull ... polygons) Create a new multi-polygon. -
Method Summary
Modifier and TypeMethodDescription@NotNull MultiPolygon
addPolygon
(@NotNull Collection<@NotNull Polygon> polygons) Add polygons to this multi-polygon.@NotNull MultiPolygon
addPolygon
(@NotNull Polygon polygon) Add a polygon to this multi-polygon.@NotNull MultiPolygon
addPolygon
(@NotNull Polygon @NotNull ... polygons) Add polygons to this multi-polygon.@NotNull MultiPolygon
Clear the list of polygons in this multi-polygon.boolean
static @NotNull MultiPolygon
fromJson
(@NotNull com.google.gson.JsonObject obj) Get the list of polygons in this multi-polygon.int
hashCode()
static @NotNull MultiPolygon
of
(@NotNull String key, @NotNull Collection<@NotNull Polygon> polygons) Create a new multi-polygon.static @NotNull MultiPolygon
Create a new multi-polygon.static @NotNull MultiPolygon
Create a new multi-polygon.@NotNull MultiPolygon
removePoly
(@NotNull Collection<@NotNull Polygon> polygons) Remove polygons from this multi-polygon.@NotNull MultiPolygon
removePoly
(@NotNull Polygon polygon) Remove a polygon from this multi-polygon.@NotNull MultiPolygon
removePoly
(@NotNull Polygon @NotNull ... polygons) Remove polygons from this multi-polygon.@NotNull com.google.gson.JsonObject
toJson()
Jsonify this object.@NotNull String
toString()
Methods inherited from class net.pl3x.map.core.markers.marker.Marker
circle, circle, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, getOptions, getPane, getType, icon, icon, icon, icon, icon, icon, icon, multiPolygon, multiPolygon, multiPolygon, multiPolyline, multiPolyline, multiPolyline, polygon, polygon, polygon, polyline, polyline, polyline, rectangle, rectangle, setOptions, setOptions, setPane
-
Constructor Details
-
MultiPolygon
Create a new multi-polygon.- Parameters:
key
- identifying keypolygon
- polygon to add
-
MultiPolygon
Create a new multi-polygon.- Parameters:
key
- identifying keypolygons
- polygons to add
-
MultiPolygon
public MultiPolygon(@NotNull @NotNull String key, @NotNull @NotNull Collection<@NotNull Polygon> polygons) Create a new multi-polygon.- Parameters:
key
- identifying keypolygons
- polygons to add
-
-
Method Details
-
of
@NotNull public static @NotNull MultiPolygon of(@NotNull @NotNull String key, @NotNull @NotNull Polygon polygon) Create a new multi-polygon.- Parameters:
key
- identifying keypolygon
- polygon to add- Returns:
- a new multi-polygon
-
of
@NotNull public static @NotNull MultiPolygon of(@NotNull @NotNull String key, @NotNull @NotNull Polygon @NotNull ... polygons) Create a new multi-polygon.- Parameters:
key
- identifying keypolygons
- polygons to add- Returns:
- a new multi-polygon
-
of
@NotNull public static @NotNull MultiPolygon of(@NotNull @NotNull String key, @NotNull @NotNull Collection<@NotNull Polygon> polygons) Create a new multi-polygon.- Parameters:
key
- identifying keypolygons
- polygons to add- Returns:
- a new multi-polygon
-
getPolygons
Get the list of polygons in this multi-polygon.- Returns:
- list of polygons
-
clearPolygons
Clear the list of polygons in this multi-polygon.- Returns:
- this multi-polygon
-
addPolygon
Add a polygon to this multi-polygon.- Parameters:
polygon
- polygon to add- Returns:
- this multi-polygon
-
addPolygon
Add polygons to this multi-polygon.- Parameters:
polygons
- polygons to add- Returns:
- this multi-polygon
-
addPolygon
@NotNull public @NotNull MultiPolygon addPolygon(@NotNull @NotNull Collection<@NotNull Polygon> polygons) Add polygons to this multi-polygon.- Parameters:
polygons
- polygons to add- Returns:
- this multi-polygon
-
removePoly
Remove a polygon from this multi-polygon.- Parameters:
polygon
- polygon to remove- Returns:
- this multi-polygon
-
removePoly
Remove polygons from this multi-polygon.- Parameters:
polygons
- polygons to remove- Returns:
- this multi-polygon
-
removePoly
@NotNull public @NotNull MultiPolygon removePoly(@NotNull @NotNull Collection<@NotNull Polygon> polygons) Remove polygons from this multi-polygon.- Parameters:
polygons
- polygons to remove- Returns:
- this multi-polygon
-
toJson
@NotNull public @NotNull com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializable
Jsonify this object.- Returns:
- object as json element
-
fromJson
@NotNull public static @NotNull MultiPolygon fromJson(@NotNull @NotNull com.google.gson.JsonObject obj) -
equals
-
hashCode
public int hashCode() -
toString
-