public final class

Polygon

extends MultiPath
implements Serializable
java.lang.Object
   ↳ com.esri.core.geometry.Geometry
     ↳ com.esri.core.geometry.MultiPath
       ↳ com.esri.core.geometry.Polygon

Class Overview

A polygon is a collection of one or many interior or exterior rings.

Summary

[Expand]
Inherited Fields
From class com.esri.core.geometry.MultiPath
From class com.esri.core.geometry.Geometry
Public Constructors
Polygon()
Creates a polygon.
Public Methods
double calculateRingArea2D(int ringIndex)
Calculates the ring area for this ring.
Geometry createInstance()
Creates an instance of an empty geometry of the same type.
boolean equals(Object other)
Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.
int getDimension()
Returns the topological dimension of the geometry object based on the geometry's type.
Geometry.Type getType()
Returns the geometry type.
int hashCode()
Returns a hash code value for this polygon.
boolean isValid()
Checks whether the Polygon is valid.
void setXY(int i, double x, double y)
Sets a new vertex for the polygon.
[Expand]
Inherited Methods
From class com.esri.core.geometry.MultiPath
From class com.esri.core.geometry.Geometry
From class java.lang.Object

Public Constructors

public Polygon ()

Creates a polygon.

Public Methods

public double calculateRingArea2D (int ringIndex)

Calculates the ring area for this ring.

Parameters
ringIndex int: The index of this ring.
Returns
double The ring area for this ring.

public Geometry createInstance ()

Creates an instance of an empty geometry of the same type.

Returns
Geometry

public boolean equals (Object other)

Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.

Parameters
other Object
Returns
boolean

public int getDimension ()

Returns the topological dimension of the geometry object based on the geometry's type.

Returns 0 for point and multipoint.

Returns 1 for lines and polylines.

Returns 2 for polygons and envelopes

Returns 3 for objects with volume

Returns
int Returns the integer value of the dimension of geometry.

public Geometry.Type getType ()

Returns the geometry type.

Returns
Geometry.Type Returns the geometry type.

public int hashCode ()

Returns a hash code value for this polygon.

Returns
int

public boolean isValid ()

Checks whether the Polygon is valid. The Polygon is valid if it contains at least one closed path which has at least 3 vertices in its path.

Returns
boolean true if the Polygon is valid

public void setXY (int i, double x, double y)

Sets a new vertex for the polygon.

Parameters
i int: The index of the new vertex.
x double: The X coordinate for the new vertex.
y double: The Y coordinate for the new vertex.