Class OneGeometry<R,G>

Type Parameters:
R - the type of resources (e.g. Feature) used as inputs.
G - the implementation type of geometry objects.
All Implemented Interfaces:
Serializable, Function<R,Object>, Expression<R,Object>, Optimization.OnExpression<R,Object>, FeatureExpression<R,Object>
Direct Known Subclasses:
OneGeometry.WithArgument

class OneGeometry<R,G> extends SpatialFunction<R>
SQLMM spatial functions taking a single geometry operand. This base class assume that the geometry is the only parameter. Subclasses may add other kind of parameters.
Since:
1.1
Version:
1.3
  • Field Details

  • Constructor Details

    • OneGeometry

      OneGeometry(SQLMM operation, Expression<? super R,?>[] parameters, Geometries<G> library)
      Creates a new function for a geometry represented by the given parameter.
  • Method Details

    • recreate

      public Expression<R,Object> recreate(Expression<? super R,?>[] effective)
      Creates a new expression of the same type than this expression, but with an optimized geometry. The optimization may be a geometry computed immediately if all operator parameters are literals.
      Parameters:
      effective - the expressions to use as a replacement of this expression parameters.
      Returns:
      the new expression, or this if unsupported.
    • getGeometryLibrary

      final Geometries<?> getGeometryLibrary()
      Returns a handler for the library of geometric objects used by this expression.
      Specified by:
      getGeometryLibrary in class SpatialFunction<R>
      Returns:
      the geometry library (never null).
      See Also:
    • getParameters

      public List<Expression<? super R,?>> getParameters()
      Returns the sub-expressions that will be evaluated to provide the parameters to the function.
      Returns:
      the sub-expressions to be evaluated, or an empty list if none.
    • apply

      public Object apply(R input)
      Evaluates the first expression as a geometry object, applies the operation and returns the result.
      Parameters:
      input - the object to be evaluated by the expression. Can be null if this expression allows null values.
      Returns:
      value computed by the expression.