likefilterimpl.html
来自「Geotools是一个开源的Java GIS工具包,可利用它来开发符合标准的地理」· HTML 代码 · 共 1,066 行 · 第 1/4 页
HTML
1,066 行
<DL><DD>Given OGC PropertyIsLike Filter information, construct an SQL-compatible 'like' pattern. SQL % --> match any number of characters _ --> match a single character NOTE; the SQL command is 'string LIKE pattern [ESCAPE escape-character]' We could re-define the escape character, but I'm not doing to do that in this code since some databases will not handle this case. Method: 1. Examples: ( escape ='!', multi='*', single='.' ) broadway* -> 'broadway%' broad_ay -> 'broad_ay' broadway -> 'broadway' broadway!* -> 'broadway*' (* has no significance and is escaped) can't -> 'can''t' ( ' escaped for SQL compliance) NOTE: we also handle "'" characters as special because they are end-of-string characters. SQL will convert ' to '' (double single quote). NOTE: we dont handle "'" as a 'special' character because it would be too confusing to have a special char as another special char. Using this will throw an error (IllegalArgumentException).<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>escape</CODE> - <DD><CODE>multi</CODE> - <DD><CODE>single</CODE> - <DD><CODE>pattern</CODE> - <DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE></DL></DD></DL><HR><A NAME="getSQL92LikePattern()"><!-- --></A><H3>getSQL92LikePattern</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getSQL92LikePattern</B>() throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></PRE><DL><DD>see convertToSQL92<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE></DL></DD></DL><HR><A NAME="setWildCard(java.lang.String)"><!-- --></A><H3>setWildCard</H3><PRE>public void <B>setWildCard</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> wildCard)</PRE><DL><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setSingleChar(java.lang.String)"><!-- --></A><H3>setSingleChar</H3><PRE>public void <B>setSingleChar</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> singleChar)</PRE><DL><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setEscape(java.lang.String)"><!-- --></A><H3>setEscape</H3><PRE>public void <B>setEscape</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> escape)</PRE><DL><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setValue(org.geotools.filter.Expression)"><!-- --></A><H3>setValue</H3><PRE>public final void <B>setValue</B>(<A HREF="../../../org/geotools/filter/Expression.html" title="interface in org.geotools.filter">Expression</A> attribute) throws <A HREF="../../../org/geotools/filter/IllegalFilterException.html" title="class in org.geotools.filter">IllegalFilterException</A></PRE><DL><DD>Sets the expression to be evalutated as being like the pattern<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/filter/LikeFilter.html#setValue(org.geotools.filter.Expression)">setValue</A></CODE> in interface <CODE><A HREF="../../../org/geotools/filter/LikeFilter.html" title="interface in org.geotools.filter">LikeFilter</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attribute</CODE> - The value of the attribute for comparison.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/geotools/filter/IllegalFilterException.html" title="class in org.geotools.filter">IllegalFilterException</A></CODE> - Filter is illegal.</DL></DD></DL><HR><A NAME="getValue()"><!-- --></A><H3>getValue</H3><PRE>public final <A HREF="../../../org/geotools/filter/Expression.html" title="interface in org.geotools.filter">Expression</A> <B>getValue</B>()</PRE><DL><DD><B>Deprecated.</B> <I>use <A HREF="../../../org/geotools/filter/LikeFilterImpl.html#getExpression()"><CODE>getExpression()</CODE></A>.</I><P><DD>Gets the Value (left hand side) of this filter.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/filter/LikeFilter.html#getValue()">getValue</A></CODE> in interface <CODE><A HREF="../../../org/geotools/filter/LikeFilter.html" title="interface in org.geotools.filter">LikeFilter</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>The expression that is the value of the filter.</DL></DD></DL><HR><A NAME="getExpression()"><!-- --></A><H3>getExpression</H3><PRE>public Expression <B>getExpression</B>()</PRE><DL><DD>Gets the expression for hte filter. <p> This method calls th deprecated <A HREF="../../../org/geotools/filter/LikeFilterImpl.html#getValue()"><CODE>getValue()</CODE></A> for backwards compatability with subclasses. </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE>getExpression</CODE> in interface <CODE>PropertyIsLike</CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setExpression(org.opengis.filter.expression.Expression)"><!-- --></A><H3>setExpression</H3><PRE>public void <B>setExpression</B>(Expression e)</PRE><DL><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setPattern(org.geotools.filter.Expression, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>setPattern</H3><PRE>public final void <B>setPattern</B>(<A HREF="../../../org/geotools/filter/Expression.html" title="interface in org.geotools.filter">Expression</A> p, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> wildcardMulti, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> wildcardSingle, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> escape)</PRE><DL><DD><B>Deprecated.</B> <I>use one of <CODE>PropertyIsLike#setExpression(Expression)</CODE> <CODE>PropertyIsLike#setWildCard(String)</CODE> <CODE>PropertyIsLike#setSingleChar(String)</CODE> <CODE>PropertyIsLike#setEscape(String)</CODE></I><P><DD>Sets the match pattern for this FilterLike.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/filter/LikeFilter.html#setPattern(org.geotools.filter.Expression, java.lang.String, java.lang.String, java.lang.String)">setPattern</A></CODE> in interface <CODE><A HREF="../../../org/geotools/filter/LikeFilter.html" title="interface in org.geotools.filter">LikeFilter</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - the expression which evaluates to the match pattern for this filter<DD><CODE>wildcardMulti</CODE> - the string that represents a mulitple character (1->n) wildcard<DD><CODE>wildcardSingle</CODE> - the string that represents a single character (1) wildcard<DD><CODE>escape</CODE> - the string that represents an escape character</DL></DD></DL><HR><A NAME="setPattern(java.lang.String, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>setPattern</H3><PRE>public final void <B>setPattern</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pattern, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> wildcardMulti, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> wildcardSingle, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> escape)</PRE><DL><DD><B>Deprecated.</B> <I>use one of <CODE>PropertyIsLike#setLiteral(String)</CODE> <CODE>PropertyIsLike#setWildCard(String)</CODE> <CODE>PropertyIsLike#setSingleChar(String)</CODE> <CODE>PropertyIsLike#setEscape(String)</CODE></I><P><DD>Sets the match pattern for this FilterLike.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/filter/LikeFilter.html#setPattern(java.lang.String, java.lang.String, java.lang.String, java.lang.String)">setPattern</A></CODE> in interface <CODE><A HREF="../../../org/geotools/filter/LikeFilter.html" title="interface in org.geotools.filter">LikeFilter</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pattern</CODE> - the string which contains the match pattern for this filter<DD><CODE>wildcardMulti</CODE> - the string that represents a mulitple character (1->n) wildcard<DD><CODE>wildcardSingle</CODE> - the string that represents a single character (1) wildcard<DD><CODE>escape</CODE> - the string that represents an escape character</DL></DD></DL><HR><A NAME="getPattern()"><!-- --></A><H3>getPattern</H3><PRE>public final <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getPattern</B>()</PRE><DL><DD><B>Deprecated.</B> <I>use <A HREF="../../../org/geotools/filter/LikeFilterImpl.html#getLiteral()"><CODE>getLiteral()</CODE></A></I><P><DD>Accessor method to retrieve the pattern.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/filter/LikeFilter.html#getPattern()">getPattern</A></CODE> in interface <CODE><A HREF="../../../org/geotools/filter/LikeFilter.html" title="interface in org.geotools.filter">LikeFilter</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the pattern being matched.</DL></DD></DL><HR><A NAME="getLiteral()"><!-- --></A><H3>getLiteral</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getLiteral</B>()</PRE><DL><DD>Returns the pattern.<P><DD><DL><DT><B>Specified by:</B><DD><CODE>getLiteral</CODE> in interface <CODE>PropertyIsLike</CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setLiteral(java.lang.String)"><!-- --></A><H3>setLiteral</H3>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?