public Expression create()

in endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/sqlmm/Registry.java [79:132]


    public <R> Expression<R,?> create(final String name, Expression<R,?>[] parameters) {
        final SQLMM operation = SQLMM.valueOf(name);
        switch (operation) {
            case ST_PointFromWKB:       // Fallthrough
            case ST_LineFromWKB:        // Fallthrough
            case ST_PolyFromWKB:        // Fallthrough
            case ST_BdPolyFromWKB :     // Fallthrough
            case ST_GeomCollFromWKB:    // Fallthrough
            case ST_MPointFromWKB:      // Fallthrough
            case ST_MLineFromWKB:       // Fallthrough
            case ST_MPolyFromWKB:       // Fallthrough
            case ST_BdMPolyFromWKB:     // Fallthrough
            case ST_GeomFromWKB:        return new ST_FromBinary<>(operation, parameters, library);
            case ST_PointFromText:      // Fallthrough
            case ST_LineFromText:       // Fallthrough
            case ST_PolyFromText:       // Fallthrough
            case ST_BdPolyFromText:     // Fallthrough
            case ST_GeomCollFromText:   // Fallthrough
            case ST_MPointFromText:     // Fallthrough
            case ST_MLineFromText:      // Fallthrough
            case ST_MPolyFromText:      // Fallthrough
            case ST_BdMPolyFromText:    // Fallthrough
            case ST_GeomFromText:       return new ST_FromText<>(operation, parameters, library);
            case ST_Polygon:            // Fallthrough
            case ST_LineString:         // Fallthrough
            case ST_MultiPoint:         // Fallthrough
            case ST_MultiLineString:    // Fallthrough
            case ST_MultiPolygon:       // Fallthrough
            case ST_GeomCollection:     return new GeometryConstructor<>(operation, parameters, library);
            case ST_Point:              return new ST_Point<>(parameters, library);
            case ST_Transform:          return new ST_Transform<>(parameters, library);
            default: {
                switch (operation.geometryCount()) {
                    case 1: {
                        if (operation.maxParamCount == 1) {
                            return new OneGeometry<>(operation, parameters, library);
                        } else {
                            return new OneGeometry.WithArgument<>(operation, parameters, library);
                        }
                    }
                    case 2: {
                        if (operation.maxParamCount == 2) {
                            return new TwoGeometries<>(operation, parameters, library);
                        } else {
                            return new TwoGeometries.WithArgument<>(operation, parameters, library);
                        }
                    }
                    default: {
                        throw new AssertionError(operation);
                    }
                }
            }
        }
    }