001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.filter;
017:
018: import org.opengis.filter.PropertyIsLike;
019: import org.geotools.feature.Feature;
020:
021: /**
022: * Defines a like filter, which checks to see if an attribute matches a REGEXP.
023: *
024: * @author Rob Hranac, Vision for New York
025: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/filter/LikeFilter.java $
026: * @version $Id: LikeFilter.java 22294 2006-10-20 00:55:40Z desruisseaux $
027: *
028: * @deprecated use {@link org.opengis.filter.PropertyIsLike}
029: */
030: public interface LikeFilter extends Filter, PropertyIsLike {
031: /**
032: * Sets the match pattern for this FilterLike.
033: *
034: * @param pattern The string which contains the match pattern for this
035: * filter.
036: * @param wildcardMulti The string that represents a mulitple character
037: * (1->n) wildcard.
038: * @param wildcardSingle The string that represents a single character (1)
039: * wildcard.
040: * @param escape The string that represents an escape character.
041: *
042: * @deprecated use one of
043: * {@link PropertyIsLike#setExpression(Expression)}
044: * {@link PropertyIsLike#setWildCard(String)}
045: * {@link PropertyIsLike#setSingleChar(String)}
046: * {@link PropertyIsLike#setEscape(String)}
047: */
048: void setPattern(String pattern, String wildcardMulti,
049: String wildcardSingle, String escape);
050:
051: /**
052: * Getter for property wildcardMulti.
053: *
054: * @return Value of property wildcardMulti.
055: *
056: * @deprecated use {@link PropertyIsLike#getWildCard()}
057: */
058: String getWildcardMulti();
059:
060: /**
061: * Accessor for property escape.
062: *
063: * @return Value of property escape.
064: *
065: * @deprecated use {@link PropertyIsLike#getEscape()}
066: */
067: String getEscape();
068:
069: /**
070: * Sets the match pattern for this FilterLike.
071: *
072: * @param p The expression which evaluates to the match pattern for this
073: * filter.
074: * @param wildcardMulti The string that represents a mulitple character
075: * (1->n) wildcard.
076: * @param wildcardSingle the string that represents a single character (1)
077: * wildcard.
078: * @param escape The string that represents an escape character.
079: *
080: * @deprecated use one of
081: * {@link PropertyIsLike#setExpression(Expression)}
082: * {@link PropertyIsLike#setWildCard(String)}
083: * {@link PropertyIsLike#setSingleChar(String)}
084: * {@link PropertyIsLike#setEscape(String)}
085: *
086: */
087: void setPattern(Expression p, String wildcardMulti,
088: String wildcardSingle, String escape);
089:
090: /**
091: * Accessor method to retrieve the pattern.
092: *
093: * @return the pattern being matched.
094: *
095: * @deprecated use {@link PropertyIsLike#getLiteral()}
096: */
097: String getPattern();
098:
099: /**
100: * Sets the expression to be evalutated as being like the pattern.
101: *
102: * @param attribute The value of the attribute for comparison.
103: *
104: * @throws IllegalFilterException Filter is illegal, adding something other
105: * than a string attribute.
106: * @deprecated use {@link PropertyIsLike#setExpression(Expression)}
107: */
108: void setValue(Expression attribute) throws IllegalFilterException;
109:
110: /**
111: * Gets the Value (left hand side) of this filter.
112: *
113: * @return The expression that is the value of the filter.
114: *
115: * @deprecated use {@link PropertyIsLike#getExpression()}
116: */
117: Expression getValue();
118:
119: /**
120: * Accessor for property wildcardSingle.
121: *
122: * @return Value of property wildcardSingle.
123: *
124: * @deprecated use {@link PropertyIsLike#getSingleChar()()}
125: */
126: String getWildcardSingle();
127:
128: /**
129: * Determines whether or not a given feature matches this pattern.
130: *
131: * @param feature Specified feature to examine.
132: *
133: * @return Flag confirming whether or not this feature is inside the
134: * filter.
135: *
136: * @task REVISIT: could the pattern be null such that a null = null?
137: * @deprecated use {@link org.opengis.filter.Filter#evaluate(Feature)}
138: */
139: boolean contains(Feature feature);
140: }
|