com.mapinfo.midev.geometry

## Interface IPolygonBuilder

    public interface IPolygonBuilder

A builder for new polygon instances.

### Method Summary

All Methods Instance Methods Abstract Methods
`Object` `build()` Creates a new polygon with the previously constructed outer ring and optional inner rings.
`PolygonRingBuilder` `withInnerRing()` Returns a builder to assist with the construction of an inner ring for the polygon to be created with this builder.
`PolygonRingBuilder` `withOuterRing()` Returns a builder to assist with the construction of the outer ring for the polygon to be created with this builder.

### Method Detail

#### withOuterRing

    PolygonRingBuilder withOuterRing()

Returns a builder to assist with the construction of the outer ring for the polygon to be created with this builder. Once the `build()` method on the returned builder is called, the outer ring will be set. Note that a polygon can only have one outer ring. Attempting to construct multiple outer rings will raise an exception.

Returns:
  a builder to construct the outer ring of the polygon to be created

#### withInnerRing

    PolygonRingBuilder withInnerRing()

Returns a builder to assist with the construction of an inner ring for the polygon to be created with this builder. Once the `build()` method on the returned builder is called, the new ring will be added to the list of inner rings. The final polygon can contain zero or more inner rings.

Returns:
  a builder to construct a new inner ring for the polygon to be created.

#### build

    Object build()

Creates a new polygon with the previously constructed outer ring and optional inner rings. Depending on the context, the new polygon is returned from this method, or added to the parent multi polygon builder.

Throws:
  `IllegalStateException` - if an attempt is made to set more than one outer ring for this polygon
  `InvalidGeometryException` - if an attempt is made to set null outer ring