Package org.locationtech.jtstest.geomop
Class TeeGeometryOperation
- java.lang.Object
-
- org.locationtech.jtstest.geomop.TeeGeometryOperation
-
- All Implemented Interfaces:
GeometryOperation
- Direct Known Subclasses:
PreparedGeometryTeeOperation
public abstract class TeeGeometryOperation extends java.lang.Object implements GeometryOperation
AGeometryOperation
which executes the original operation and returns that result, but also executes a separate operation (which could be multiple operations). The side operations can throw exceptions if they do not compute correct results. This relies on the availability of another reliable implementation to provide the expected result.This class can be used via the -geomop command-line option or by the <geometryOperation> XML test file setting.
-
-
Field Summary
Fields Modifier and Type Field Description private GeometryMethodOperation
chainOp
-
Constructor Summary
Constructors Constructor Description TeeGeometryOperation()
TeeGeometryOperation(GeometryMethodOperation chainOp)
Creates a new operation which chains to the givenGeometryMethodOperation
for non-intercepted methods.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Class
getReturnType(java.lang.String opName)
Gets the class of the return type of the given operation.Result
invoke(java.lang.String opName, Geometry geometry, java.lang.Object[] args)
Invokes the named operationprotected abstract void
runTeeOp(java.lang.String opName, Geometry geometry, java.lang.Object[] args)
-
-
-
Field Detail
-
chainOp
private GeometryMethodOperation chainOp
-
-
Constructor Detail
-
TeeGeometryOperation
public TeeGeometryOperation()
-
TeeGeometryOperation
public TeeGeometryOperation(GeometryMethodOperation chainOp)
Creates a new operation which chains to the givenGeometryMethodOperation
for non-intercepted methods.- Parameters:
chainOp
- the operation to chain to
-
-
Method Detail
-
getReturnType
public java.lang.Class getReturnType(java.lang.String opName)
Description copied from interface:GeometryOperation
Gets the class of the return type of the given operation.- Specified by:
getReturnType
in interfaceGeometryOperation
- Parameters:
opName
- the name of the operation- Returns:
- the class of the return type of the specified operation
-
invoke
public Result invoke(java.lang.String opName, Geometry geometry, java.lang.Object[] args) throws java.lang.Exception
Invokes the named operation- Specified by:
invoke
in interfaceGeometryOperation
- Parameters:
opName
-geometry
-args
-- Returns:
- the result
- Throws:
java.lang.Exception
- See Also:
GeometryOperation.invoke(java.lang.String, org.locationtech.jts.geom.Geometry, java.lang.Object[])
-
runTeeOp
protected abstract void runTeeOp(java.lang.String opName, Geometry geometry, java.lang.Object[] args)
-
-