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 name,
String[] parameterNames,
Class[] parameterTypes,
Class returnType) |
BaseGeometryFunction(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).
|
String |
getCategory() |
String |
getDescription() |
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
|
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 name, String[] parameterNames, Class[] parameterTypes, Class returnType)
public static boolean isBinaryGeomFunction(GeometryFunction func)
public String getCategory()
public String getName()
GeometryFunction
getName
in interface GeometryFunction
public String getDescription()
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 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 © 2019. All rights reserved.