public final class GeoPolygon extends GeoPolyline
GeoPolygon
a polygon object defined in terms of the geographic coordinates of its vertices.
The only difference between a GeoPolygon
and a GeoPolyline
is
that the polygon represents a closed loop of points. The minimum number of points in a GeoPolygon
must be
three.
This class can be used with MapPolygon
to render
a polygon.
Constructor and Description |
---|
GeoPolygon()
Default Constructor
|
GeoPolygon(java.util.List<GeoCoordinate> points)
Constructor that creates a new instance of
GeoPolygon from a list of points. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Checks whether the given
GeoPolygon object is
equal to that supplied by the caller. |
int |
hashCode()
Obtains the hash code for the given object.
|
add, add, clear, contains, getBoundingBox, getNearest, getNearestIndex, getNumberOfPoints, getPoint, insert, length, remove
public GeoPolygon()
public GeoPolygon(java.util.List<GeoCoordinate> points)
GeoPolygon
from a list of points.points
- A list of points to form the GeoPolygon
.MapPolygon
public int hashCode()
hashCode
in class GeoPolyline
public boolean equals(java.lang.Object other)
GeoPolygon
object is
equal to that supplied by the caller. Two objects are equal if they are
both instances of GeoPolygon
and the coordinates of their
vertices are the same.equals
in class GeoPolyline
other
- A polygon object to compare to the given polygon.true
if the polygons are equal, otherwise
false
.