public abstract class BaseGeometryFunction extends java.lang.Object implements GeometryFunction, java.lang.Comparable
GeometryFunction
which provides most
of the required structure.
Extenders must supply the behaviour for the
actual function invocation.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
category |
protected java.lang.String |
description |
protected java.lang.String |
name |
protected java.lang.String[] |
parameterNames |
protected java.lang.Class[] |
parameterTypes |
protected java.lang.Class |
returnType |
Constructor and Description |
---|
BaseGeometryFunction(java.lang.String name,
java.lang.String[] parameterNames,
java.lang.Class[] parameterTypes,
java.lang.Class returnType) |
BaseGeometryFunction(java.lang.String name,
java.lang.String description,
java.lang.String[] parameterNames,
java.lang.Class[] parameterTypes,
java.lang.Class returnType) |
Modifier and Type | Method and Description |
---|---|
private static int |
compareTo(java.lang.Class c1,
java.lang.Class c2) |
int |
compareTo(java.lang.Object o) |
boolean |
equals(java.lang.Object obj)
Two functions are the same if they have the
same signature (name, parameter types and return type).
|
java.lang.String |
getCategory() |
java.lang.String |
getDescription() |
protected static java.lang.Double |
getDoubleOrNull(java.lang.Object[] args,
int index) |
protected static java.lang.Integer |
getIntegerOrNull(java.lang.Object[] args,
int index) |
java.lang.String |
getName()
Gets the name of this function
|
java.lang.String[] |
getParameterNames()
Gets the parameter names for this function
|
java.lang.Class[] |
getParameterTypes()
Gets the types of the other function arguments,
if any.
|
java.lang.Class |
getReturnType()
Gets the return type of this function
|
abstract java.lang.Object |
invoke(Geometry geom,
java.lang.Object[] args)
Invokes this function.
|
boolean |
isBinary() |
static boolean |
isBinaryGeomFunction(GeometryFunction func) |
protected java.lang.String category
protected java.lang.String name
protected java.lang.String description
protected java.lang.String[] parameterNames
protected java.lang.Class[] parameterTypes
protected java.lang.Class returnType
public BaseGeometryFunction(java.lang.String name, java.lang.String[] parameterNames, java.lang.Class[] parameterTypes, java.lang.Class returnType)
public BaseGeometryFunction(java.lang.String name, java.lang.String description, java.lang.String[] parameterNames, java.lang.Class[] parameterTypes, java.lang.Class returnType)
public static boolean isBinaryGeomFunction(GeometryFunction func)
public java.lang.String getCategory()
public java.lang.String getName()
GeometryFunction
getName
in interface GeometryFunction
public java.lang.String getDescription()
public java.lang.String[] getParameterNames()
GeometryFunction
getParameterNames
in interface GeometryFunction
public java.lang.Class[] getParameterTypes()
getParameterTypes
in interface GeometryFunction
public java.lang.Class getReturnType()
GeometryFunction
getReturnType
in interface GeometryFunction
public boolean isBinary()
isBinary
in interface GeometryFunction
protected static java.lang.Double getDoubleOrNull(java.lang.Object[] args, int index)
protected static java.lang.Integer getIntegerOrNull(java.lang.Object[] args, int index)
public abstract java.lang.Object invoke(Geometry geom, java.lang.Object[] args)
GeometryFunction
RuntimeException
s.invoke
in interface GeometryFunction
geom
- the target geometryargs
- the other arguments to the functionpublic boolean equals(java.lang.Object obj)
equals
in interface GeometryFunction
equals
in class java.lang.Object
obj
- public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
private static int compareTo(java.lang.Class c1, java.lang.Class c2)