public abstract class BaseGeometryFunction extends Object implements GeometryFunction, 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 String |
category |
protected String |
description |
protected String |
name |
protected String[] |
parameterNames |
protected Class[] |
parameterTypes |
protected Class |
returnType |
Constructor and Description |
---|
BaseGeometryFunction(String category,
String name,
String[] parameterNames,
Class[] parameterTypes,
Class returnType) |
BaseGeometryFunction(String category,
String name,
String description,
String[] parameterNames,
Class[] parameterTypes,
Class returnType) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o) |
boolean |
equals(Object obj)
Two functions are the same if they have the
same signature (name, parameter types and return type).
|
static int |
firstScalarParamIndex(GeometryFunction func) |
String |
getCategory()
Gets the category name of this function
|
String |
getDescription()
Gets the description of this function
|
protected static Double |
getDoubleOrNull(Object[] args,
int index) |
protected static Integer |
getIntegerOrNull(Object[] args,
int index) |
String |
getName()
Gets the name of this function
|
String[] |
getParameterNames()
Gets the parameter names for this function
|
Class[] |
getParameterTypes()
Gets the types of the other function arguments,
if any.
|
Class |
getReturnType()
Gets the return type of this function
|
String |
getSignature()
Gets a string representing the signature of this function.
|
abstract Object |
invoke(Geometry geom,
Object[] args)
Invokes this function.
|
boolean |
isBinary() |
static boolean |
isBinaryGeomFunction(GeometryFunction func) |
protected String category
protected String name
protected String description
protected String[] parameterNames
protected Class[] parameterTypes
protected Class returnType
public BaseGeometryFunction(String category, String name, String[] parameterNames, Class[] parameterTypes, Class returnType)
public static boolean isBinaryGeomFunction(GeometryFunction func)
public static int firstScalarParamIndex(GeometryFunction func)
public String getCategory()
GeometryFunction
getCategory
in interface GeometryFunction
public String getName()
GeometryFunction
getName
in interface GeometryFunction
public String getDescription()
GeometryFunction
getDescription
in interface GeometryFunction
public String[] getParameterNames()
GeometryFunction
getParameterNames
in interface GeometryFunction
public Class[] getParameterTypes()
getParameterTypes
in interface GeometryFunction
public Class getReturnType()
GeometryFunction
getReturnType
in interface GeometryFunction
public boolean isBinary()
isBinary
in interface GeometryFunction
public String getSignature()
GeometryFunction
getSignature
in interface GeometryFunction
public abstract Object invoke(Geometry geom, Object[] args)
GeometryFunction
RuntimeException
s.invoke
in interface GeometryFunction
geom
- the target geometryargs
- the other arguments to the functionpublic boolean equals(Object obj)
equals
in interface GeometryFunction
equals
in class Object
obj
- public int compareTo(Object o)
compareTo
in interface Comparable
Copyright © 2022. All rights reserved.