org.apache.slide.search.basic.expression
Class LikeExpression

java.lang.Object
  extended byorg.apache.slide.search.basic.expression.BasicExpression
      extended byorg.apache.slide.search.basic.expression.GenericBasicExpression
          extended byorg.apache.slide.search.basic.expression.CompareExpression
              extended byorg.apache.slide.search.basic.expression.ComparePropertyExpression
                  extended byorg.apache.slide.search.basic.expression.LikeExpression
All Implemented Interfaces:
IBasicExpression
Direct Known Subclasses:
NotLikeExpression

public class LikeExpression
extends ComparePropertyExpression

Implements the like operator.


Field Summary
 
Fields inherited from class org.apache.slide.search.basic.expression.ComparePropertyExpression
comparedProperty
 
Fields inherited from class org.apache.slide.search.basic.expression.CompareExpression
propertyProvider, requestedResourcesPool
 
Fields inherited from class org.apache.slide.search.basic.expression.BasicExpression
expressionElement, expressionFactory, resultSet
 
Constructor Summary
LikeExpression(org.jdom.Element e, ComparableResourcesPool requestedResourcesPool)
           
 
Method Summary
protected  boolean compare(ComparableResource item)
          The concrete CompareExpression must overwrite this.
static void main(java.lang.String[] args)
           
 java.lang.String toString()
           
static boolean wildcardEquals(java.lang.String pattern, int patternIdx, java.lang.String string, int stringIdx)
          Determines if a word matches a wildcard pattern.
 
Methods inherited from class org.apache.slide.search.basic.expression.ComparePropertyExpression
getLiteral, toString
 
Methods inherited from class org.apache.slide.search.basic.expression.CompareExpression
execute, getRequestedResourcePool, setRequestedResourcePool
 
Methods inherited from class org.apache.slide.search.basic.expression.BasicExpression
getFactory, setFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LikeExpression

public LikeExpression(org.jdom.Element e,
                      ComparableResourcesPool requestedResourcesPool)
               throws InvalidQueryException
Method Detail

compare

protected boolean compare(ComparableResource item)
Description copied from class: ComparePropertyExpression
The concrete CompareExpression must overwrite this.

Specified by:
compare in class ComparePropertyExpression
Parameters:
item - one BasicDataItem out of pool
Returns:
a boolean

toString

public java.lang.String toString()

wildcardEquals

public static final boolean wildcardEquals(java.lang.String pattern,
                                           int patternIdx,
                                           java.lang.String string,
                                           int stringIdx)
Determines if a word matches a wildcard pattern. Taken from Lucenes WildcardTermEnum.


main

public static void main(java.lang.String[] args)