com.vividsolutions.jump.workbench.ui.plugin.analysis
Class GeometryFunction

java.lang.Object
  extended by com.vividsolutions.jump.workbench.ui.plugin.analysis.GeometryFunction

public abstract class GeometryFunction
extends java.lang.Object

A function object for Geometry functions (which return a Geometry). Provides metadata about the function.

Version:
1.0
Author:
Martin Davis

Constructor Summary
GeometryFunction(java.lang.String name, int nArgs, int nParams)
           
GeometryFunction(java.lang.String name, int nArgs, int nParams, java.lang.String description)
           
 
Method Summary
abstract  com.vividsolutions.jts.geom.Geometry execute(com.vividsolutions.jts.geom.Geometry[] geom, double[] param)
          Exectute the function on the geometry(s) in the geom array.
 java.lang.String getDescription()
           
static GeometryFunction getFunction(java.util.Collection functions, java.lang.String name)
           
static GeometryFunction getFunction(java.lang.String name)
           
static GeometryFunction[] getFunctions()
           
 int getGeometryArgumentCount()
           
 java.lang.String getName()
           
static java.util.List getNames()
           
static java.util.List getNames(java.util.Collection functions)
           
 int getParameterCount()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeometryFunction

public GeometryFunction(java.lang.String name,
                        int nArgs,
                        int nParams)

GeometryFunction

public GeometryFunction(java.lang.String name,
                        int nArgs,
                        int nParams,
                        java.lang.String description)
Method Detail

getNames

public static java.util.List getNames()

getNames

public static java.util.List getNames(java.util.Collection functions)

getFunction

public static GeometryFunction getFunction(java.lang.String name)

getFunction

public static GeometryFunction getFunction(java.util.Collection functions,
                                           java.lang.String name)

getFunctions

public static GeometryFunction[] getFunctions()

getName

public java.lang.String getName()

getGeometryArgumentCount

public int getGeometryArgumentCount()

getParameterCount

public int getParameterCount()

getDescription

public java.lang.String getDescription()

execute

public abstract com.vividsolutions.jts.geom.Geometry execute(com.vividsolutions.jts.geom.Geometry[] geom,
                                                             double[] param)
Exectute the function on the geometry(s) in the geom array. The function can expect that the correct number of geometry arguments is present in the array. Integer parameters must be passed as doubles. If no result can be computed for some reason, null should be returned to indicate this to the caller. Exceptions may be thrown and must be handled by the caller.

Parameters:
geom - the geometry arguments
param - any non-geometric arguments.
Returns:
the geometry result, or null if no result could be computed.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object