org.postgis

## Class Polygon

- java.lang.Object
- - org.postgis.Geometry
  - - org.postgis.ComposedGeom
    - - org.postgis.Polygon

All Implemented Interfaces:
  Serializable

    public class Polygon
    extends ComposedGeom

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.postgis.ComposedGeom

`EMPTY, subgeoms`

### Fields inherited from class org.postgis.Geometry

`ALLTYPES, dimension, GEOMETRYCOLLECTION, haveMeasure, LINEARRING, LINESTRING, MULTILINESTRING, MULTIPOINT, MULTIPOLYGON, POINT, POLYGON, srid, type, UNKNOWN_SRID`

### Constructor Summary

Constructors
Constructor and Description
`Polygon()`
`Polygon(LinearRing[] rings)`
`Polygon(String value)`
`Polygon(String value, boolean haveM)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected Geometry[]` `createSubGeomArray(int ringcount)` Return the appropriate instance of the subgeometry array - this encapsulates subclass specific array instantiation
`protected Geometry` `createSubGeomInstance(String token, boolean haveM)` Return the appropriate instance of the subgeometry - this encapsulates subclass specific constructor calls
`LinearRing` `getRing(int idx)`
`int` `numRings()`

### Methods inherited from class org.postgis.ComposedGeom

`checkConsistency, equalsintern, getFirstPoint, getLastPoint, getPoint, getSubGeometry, hashCode, innerWKT, isEmpty, iterator, mediumWKT, numGeoms, numPoints, setSrid`

### Methods inherited from class org.postgis.Geometry

`equals, equals, getDimension, getSrid, getType, getTypeString, getTypeString, getValue, initSRID, isMeasured, outerWKT, outerWKT, parseSRID, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Polygon

    public Polygon()

#### Polygon

    public Polygon(LinearRing[] rings)

#### Polygon

    public Polygon(String value)
            throws SQLException

Throws:
  `SQLException`

#### Polygon

    public Polygon(String value,
                   boolean haveM)
            throws SQLException

Throws:
  `SQLException`

### Method Detail

#### createSubGeomInstance

    protected Geometry createSubGeomInstance(String token,
                                             boolean haveM)
                                      throws SQLException

Description copied from class: `ComposedGeom`
Return the appropriate instance of the subgeometry - this encapsulates subclass specific constructor calls

Specified by:
  `createSubGeomInstance` in class `ComposedGeom`
Throws:
  `SQLException`

#### createSubGeomArray

    protected Geometry[] createSubGeomArray(int ringcount)

Description copied from class: `ComposedGeom`
Return the appropriate instance of the subgeometry array - this encapsulates subclass specific array instantiation

Specified by:
  `createSubGeomArray` in class `ComposedGeom`

#### numRings

    public int numRings()

#### getRing

    public LinearRing getRing(int idx)