Class RepeaterGeometryFunction
- java.lang.Object
-
- org.locationtech.jtstest.geomfunction.RepeaterGeometryFunction
-
- All Implemented Interfaces:
GeometryFunction
public class RepeaterGeometryFunction extends Object implements GeometryFunction
Repeats a function a given number of times. If the function has a single numeric argument, the argument will be multiplied by the repeat counter for every call, and the function results will be accumulated into a collection to provide the final result.- Author:
- Martin Davis
-
-
Constructor Summary
Constructors Constructor Description RepeaterGeometryFunction(GeometryFunction fun, int count)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCategory()
Gets the category name of this functionString
getDescription()
Gets the description of this functionString
getName()
Gets the name of this functionString[]
getParameterNames()
Gets the parameter names for this functionClass<?>[]
getParameterTypes()
Gets the types of the other function arguments, if any.Class<?>
getReturnType()
Gets the return type of this functionString
getSignature()
Gets a string representing the signature of this function.static boolean
hasRepeatableArg(GeometryFunction fun)
Object
invoke(Geometry geom, Object[] args)
Invokes this function.boolean
isBinary()
static boolean
isRepeatable(GeometryFunction fun)
boolean
isRequiredB()
static int
repeatableArgIndex(GeometryFunction fun)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.locationtech.jtstest.geomfunction.GeometryFunction
equals
-
-
-
-
Constructor Detail
-
RepeaterGeometryFunction
public RepeaterGeometryFunction(GeometryFunction fun, int count)
-
-
Method Detail
-
getCategory
public String 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
public String getName()
Description copied from interface:GeometryFunction
Gets the name of this function- Specified by:
getName
in interfaceGeometryFunction
- Returns:
- the name of the function
-
getDescription
public String getDescription()
Description copied from interface:GeometryFunction
Gets the description of this function- Specified by:
getDescription
in interfaceGeometryFunction
- Returns:
- the name of the function
-
getParameterNames
public String[] 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
public Class<?>[] getParameterTypes()
Description copied from interface:GeometryFunction
Gets the types of the other function arguments, if any.- Specified by:
getParameterTypes
in interfaceGeometryFunction
- Returns:
- the types
-
getReturnType
public Class<?> 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
-
getSignature
public String 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
-
isBinary
public boolean isBinary()
- Specified by:
isBinary
in interfaceGeometryFunction
-
isRequiredB
public boolean isRequiredB()
- Specified by:
isRequiredB
in interfaceGeometryFunction
-
invoke
public Object invoke(Geometry geom, Object[] args)
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
-
isRepeatable
public static boolean isRepeatable(GeometryFunction fun)
-
hasRepeatableArg
public static boolean hasRepeatableArg(GeometryFunction fun)
-
repeatableArgIndex
public static int repeatableArgIndex(GeometryFunction fun)
-
-