/* * Geotools2 - OpenSource mapping toolkit * http://geotools.org * (C) 2002, 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 a complex filter (could also be called logical filter). This filter * holds one or more filters together and relates them logically in an * internally defined manner. * * @author Rob Hranac, TOPP * @version $Id$ */ public class GeometryExpressionImpl extends DefaultExpression { /** Holds all sub filters of this filter. */ protected String attPath; /** Holds all sub filters of this filter. */ protected String colName = null; /** * Constructor with the schema for this attribute. * * @param schema The schema for this attribute. */ protected GeometryExpressionImpl(String colName) { this.colName = colName; this.expressionType = ATTRIBUTE; } /** * Gets the value of this attribute from the passed feature. * * @param feature Feature from which to extract attribute value. * * @return DOCUMENT ME! */ public Object getValue(Feature feature) { return feature.getAttribute(attPath); } /** * Return this expression as a string. * * @return String representation of this attribute expression. */ public String toString() { return attPath; } /** * 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); */ public void accept(FilterVisitor visitor) { visitor.visit(this); } }