/*
 *    GeoTools - OpenSource mapping toolkit
 *    http://geotools.org
 *    (C) 2002-2006, GeoTools Project Managment Committee (PMC)
 *
 *    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;

import org.geotools.feature.Feature;


/**
 * Defines an expression, the units that make up Filters.   This filter holds
 * one or more filters together and relates them logically in an internally
 * defined manner.
 *
 * @author Rob Hranac, Vision for New York
 * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/filter/Expression.java $
 * @version $Id: Expression.java 22294 2006-10-20 00:55:40Z desruisseaux $
 *
 * @deprecated use {@link org.opengis.filter.expression.Expression}
 */
public interface Expression extends ExpressionType, org.opengis.filter.expression.Expression {
    /**
     * Gets the type of this expression.
     *
     * @return Expression type.
     *
     * @deprecated The enumeration based type system has been replaced by a
     * class based type system.
     */
    short getType();

    /**
     * Evaluates the expression against an instance of {@link Feature}.
     *
     * @param feature The feature being evaluated.
     *
     * @return The result.
     */
    Object evaluate(Feature feature);

    /**
     * Returns a value for this expression.  The feature argument is used if a
     * feature is needed to evaluate the expression, as in the case of an
     * AttributeExpression.
     *
     * @param feature Specified feature to use when returning value.   Some
     *        expressions, such as LiteralExpressions, may ignore this as it
     *        does not affect their return value.
     *
     * @return Value of the expression, evaluated with the feature object if
     *         necessary.
     *
     * @deprecated use {@link org.opengis.filter.expression.Expression#evaluate(Feature)}
     */
    Object getValue(Feature feature);

    /**
     * Used by FilterVisitors to perform some action on this filter instance.
     * Typicaly used by Filter decoders, but may also be used by any thing
     * which needs infomration from filter structure. Implementations should
     * always call: visitor.visit(this); It is importatant that this is not
     * left to a parent class unless the parents API is identical.
     *
     * @param visitor The visitor which requires access to this filter, the
     *        method must call visitor.visit(this);
     * @deprecated use use {@link org.opengis.filter.expression.Expression#accept(ExpressionVisitor, Object)}
     */
    void accept(FilterVisitor visitor);
}
