<commit_before>/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 * 
 *    (C) 2002-2008, Open Source Geospatial Foundation (OSGeo)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.filter.visitor;

import java.util.Iterator;
import java.util.logging.Logger;

import org.geotools.filter.AttributeExpression;
import org.geotools.filter.BetweenFilter;
import org.geotools.filter.CompareFilter;
import org.geotools.filter.ExpressionType;
import org.geotools.filter.FidFilter;
import org.geotools.filter.FilterType;
import org.geotools.filter.FunctionExpression;
import org.geotools.filter.GeometryFilter;
import org.geotools.filter.IllegalFilterException;
import org.geotools.filter.LikeFilter;
import org.geotools.filter.LiteralExpression;
import org.geotools.filter.LogicFilter;
import org.geotools.filter.MathExpression;
import org.geotools.filter.NullFilter;
import org.opengis.filter.ExcludeFilter;
import org.opengis.filter.IncludeFilter;

import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;

/**
 * Visit the BBOX filter elements and make sure they are valid.
 * <p>
 * Any BBOX filter using a literal geometry will be changed to be a literal envelope
 * based on the geometry internal envelope. If a max bounding box has been provided
 * it will be used to clip this request envelope.
 * <p> 
 * @author Jody
 *
 * @source $URL$
 */
public class WFSBBoxFilterVisitor implements org.geotools.filter.FilterVisitor2 {
    private static final Logger logger=org.geotools.util.logging.Logging.getLogger("org.geotools.filter");                
    Envelope maxbbox;
    public WFSBBoxFilterVisitor() {
        this( null );
    }
    public WFSBBoxFilterVisitor(Envelope fsd) {
        maxbbox = fsd;
    }
    public void visit(org.geotools.filter.Filter filter) {
        if (org.geotools.filter.Filter.NONE == filter) {
            return;
        }
            switch (((org.geotools.filter.Filter)filter).getFilterType()) {
            case FilterType.BETWEEN:
                visit((BetweenFilter) filter);

                break;

            case FilterType.COMPARE_EQUALS:
            case FilterType.COMPARE_GREATER_THAN:
            case FilterType.COMPARE_GREATER_THAN_EQUAL:
            case FilterType.COMPARE_LESS_THAN:
            case FilterType.COMPARE_LESS_THAN_EQUAL:
            case FilterType.COMPARE_NOT_EQUALS:
                visit((BetweenFilter) filter);

                break;
<commit_msg>Deprecate WFSBBoxFilterVisitor<commit_after>/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 * 
 *    (C) 2002-2008, Open Source Geospatial Foundation (OSGeo)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.filter.visitor;

import java.util.Iterator;
import java.util.logging.Logger;

import org.geotools.filter.AttributeExpression;
import org.geotools.filter.BetweenFilter;
import org.geotools.filter.CompareFilter;
import org.geotools.filter.ExpressionType;
import org.geotools.filter.FidFilter;
import org.geotools.filter.FilterType;
import org.geotools.filter.FunctionExpression;
import org.geotools.filter.GeometryFilter;
import org.geotools.filter.IllegalFilterException;
import org.geotools.filter.LikeFilter;
import org.geotools.filter.LiteralExpression;
import org.geotools.filter.LogicFilter;
import org.geotools.filter.MathExpression;
import org.geotools.filter.NullFilter;
import org.opengis.filter.ExcludeFilter;
import org.opengis.filter.IncludeFilter;

import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;

/**
 * Visit the BBOX filter elements and make sure they are valid.
 * <p>
 * Any BBOX filter using a literal geometry will be changed to be a literal envelope
 * based on the geometry internal envelope. If a max bounding box has been provided
 * it will be used to clip this request envelope.
 * <p> 
 * @author Jody
 * @source $URL$
 * @deprecated Use the replacement FixBBOXFilterVisitor
 */
public class WFSBBoxFilterVisitor implements org.geotools.filter.FilterVisitor2 {
    private static final Logger logger=org.geotools.util.logging.Logging.getLogger("org.geotools.filter");                
    Envelope maxbbox;
    public WFSBBoxFilterVisitor() {
        this( null );
    }
    public WFSBBoxFilterVisitor(Envelope fsd) {
        maxbbox = fsd;
    }
    public void visit(org.geotools.filter.Filter filter) {
        if (org.geotools.filter.Filter.NONE == filter) {
            return;
        }
            switch (((org.geotools.filter.Filter)filter).getFilterType()) {
            case FilterType.BETWEEN:
                visit((BetweenFilter) filter);

                break;

            case FilterType.COMPARE_EQUALS:
            case FilterType.COMPARE_GREATER_THAN:
            case FilterType.COMPARE_GREATER_THAN_EQUAL:
            case FilterType.COMPARE_LESS_THAN:
            case FilterType.COMPARE_LESS_THAN_EQUAL:
            case FilterType.COMPARE_NOT_EQUALS:
                visit((BetweenFilter) filter);

                break;

{'fraction_non_alphanumeric': 0.0799671592775041, 'fraction_numerical': 0.00361247947454844, 'mean_word_length': 3.286418015482055, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1797831', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1765, 'n_words': 484}