Class BaseGeometryFunction
java.lang.Object
org.locationtech.jtstest.geomfunction.BaseGeometryFunction
- All Implemented Interfaces:
Comparable
,GeometryFunction
- Direct Known Subclasses:
StaticMethodGeometryFunction
A base for implementations of
GeometryFunction
which provides most
of the required structure.
Extenders must supply the behaviour for the
actual function invocation.- Author:
- Martin Davis
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Two functions are the same if they have the same signature (name, parameter types and return type).static int
Gets the category name of this functionGets the description of this functionprotected static Double
getDoubleOrNull
(Object[] args, int index) protected static Integer
getIntegerOrNull
(Object[] args, int index) getName()
Gets the name of this functionString[]
Gets the parameter names for this functionClass[]
Gets the types of the other function arguments, if any.Gets the return type of this functionGets a string representing the signature of this function.int
hashCode()
abstract Object
Invokes this function.boolean
isBinary()
static boolean
boolean
-
Field Details
-
category
-
name
-
description
-
parameterNames
-
parameterTypes
-
returnType
-
isRequiredB
protected boolean isRequiredB
-
-
Constructor Details
-
BaseGeometryFunction
-
BaseGeometryFunction
-
-
Method Details
-
isBinaryGeomFunction
-
firstScalarParamIndex
-
getCategory
Description copied from interface:GeometryFunction
Gets the category name of this function- Specified by:
getCategory
in interfaceGeometryFunction
- Returns:
- the category name of the function
-
getName
Description copied from interface:GeometryFunction
Gets the name of this function- Specified by:
getName
in interfaceGeometryFunction
- Returns:
- the name of the function
-
getDescription
Description copied from interface:GeometryFunction
Gets the description of this function- Specified by:
getDescription
in interfaceGeometryFunction
- Returns:
- the name of the function
-
getParameterNames
Description copied from interface:GeometryFunction
Gets the parameter names for this function- Specified by:
getParameterNames
in interfaceGeometryFunction
- Returns:
- the names of the function parameters
-
getParameterTypes
Gets the types of the other function arguments, if any.- Specified by:
getParameterTypes
in interfaceGeometryFunction
- Returns:
- the types
-
getReturnType
Description copied from interface:GeometryFunction
Gets the return type of this function- Specified by:
getReturnType
in interfaceGeometryFunction
- Returns:
- the type of the value returned by this function
-
isBinary
public boolean isBinary()- Specified by:
isBinary
in interfaceGeometryFunction
-
isRequiredB
public boolean isRequiredB()- Specified by:
isRequiredB
in interfaceGeometryFunction
-
getSignature
Description copied from interface:GeometryFunction
Gets a string representing the signature of this function.- Specified by:
getSignature
in interfaceGeometryFunction
- Returns:
- the string for the function signature
-
getDoubleOrNull
-
getIntegerOrNull
-
invoke
Description copied from interface:GeometryFunction
Invokes this function. Note that any exceptions returned must beRuntimeException
s.- Specified by:
invoke
in interfaceGeometryFunction
- Parameters:
geom
- the target geometryargs
- the other arguments to the function- Returns:
- the value computed by the function
-
equals
Two functions are the same if they have the same signature (name, parameter types and return type).- Specified by:
equals
in interfaceGeometryFunction
- Overrides:
equals
in classObject
- Parameters:
obj
-- Returns:
- true if this object is the same as the obj argument
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable
-