org.geotools.geometry.jts
Class FactoryFinder

java.lang.Object
  extended byorg.geotools.geometry.jts.FactoryFinder

public class FactoryFinder
extends java.lang.Object

Defines static methods used to access geometry, coordinate sequence or precision model factories.

Version:
$Id: FactoryFinder.java 17701 2006-01-23 00:00:51Z desruisseaux $
Author:
Martin Desruisseaux

Method Summary
static java.util.Set getCoordinateSequenceFactories()
          Returns a set of all available implementations for the CoordinateSequenceFactory interface.
static com.vividsolutions.jts.geom.CoordinateSequenceFactory getCoordinateSequenceFactory(Hints hints)
          Returns the first implementation of CoordinateSequenceFactory matching the specified hints.
static java.util.Set getGeometryFactories()
          Returns a set of all available implementations for the GeometryFactory category.
static com.vividsolutions.jts.geom.GeometryFactory getGeometryFactory(Hints hints)
          Returns the first implementation of GeometryFactory matching the specified hints.
static com.vividsolutions.jts.geom.PrecisionModel getPrecisionModel(Hints hints)
          Returns the first implementation of PrecisionModel matching the specified hints.
static java.util.Set getPrecisionModels()
          Returns a set of all available implementations for the PrecisionModel category.
static void scanForPlugins()
          Scans for factory plug-ins on the application class path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGeometryFactory

public static com.vividsolutions.jts.geom.GeometryFactory getGeometryFactory(Hints hints)
                                                                      throws FactoryRegistryException
Returns the first implementation of GeometryFactory matching the specified hints. If no implementation matches, a new one is created if possible or an exception is thrown otherwise.

Hints that may be understood includes JTS_COORDINATE_SEQUENCE_FACTORY, JTS_PRECISION_MODEL and JTS_SRID.

Parameters:
hints - An optional map of hints, or if none.
Returns:
The first geometry factory that matches the supplied hints.
Throws:
FactoryRegistryException - if no implementation was found or can be created for the GeometryFactory category and the given hints.

getGeometryFactories

public static java.util.Set getGeometryFactories()
Returns a set of all available implementations for the GeometryFactory category.

Returns:
Set of available geometry factory implementations.

getPrecisionModel

public static com.vividsolutions.jts.geom.PrecisionModel getPrecisionModel(Hints hints)
                                                                    throws FactoryRegistryException
Returns the first implementation of PrecisionModel matching the specified hints. If no implementation matches, a new one is created if possible or an exception is thrown otherwise.

Parameters:
hints - An optional map of hints, or if none.
Returns:
The first precision model that matches the supplied hints.
Throws:
FactoryRegistryException - if no implementation was found or can be created for the PrecisionModel category and the given hints.

getPrecisionModels

public static java.util.Set getPrecisionModels()
Returns a set of all available implementations for the PrecisionModel category.

Returns:
Set of available precision model implementations.

getCoordinateSequenceFactory

public static com.vividsolutions.jts.geom.CoordinateSequenceFactory getCoordinateSequenceFactory(Hints hints)
                                                                                          throws FactoryRegistryException
Returns the first implementation of CoordinateSequenceFactory matching the specified hints. If no implementation matches, a new one is created if possible or an exception is thrown otherwise.

Parameters:
hints - An optional map of hints, or if none.
Returns:
The first coordinate sequence factory that matches the supplied hints.
Throws:
FactoryRegistryException - if no implementation was found or can be created for the CoordinateSequenceFactory interface and the given hints.

getCoordinateSequenceFactories

public static java.util.Set getCoordinateSequenceFactories()
Returns a set of all available implementations for the CoordinateSequenceFactory interface.

Returns:
Set of available coordinate sequence factory implementations.

scanForPlugins

public static void scanForPlugins()
Scans for factory plug-ins on the application class path. This method is needed because the application class path can theoretically change, or additional plug-ins may become available. Rather than re-scanning the classpath on every invocation of the API, the class path is scanned automatically only on the first invocation. Clients can call this method to prompt a re-scan. Thus this method need only be invoked by sophisticated applications which dynamically make new plug-ins available at runtime.



Copyright © GeoTools. All Rights Reserved.