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

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
All Implemented Interfaces:
IBasicExpression
Direct Known Subclasses:
ComparePropertyExpression, ContainsExpression

public abstract class CompareExpression
extends GenericBasicExpression

Abstract base class for compare expressions (property compares, contains).

Version:
$Revision: 1.5 $

Field Summary
protected  PropertyProvider propertyProvider
          The PropertyProvider to use (may be null).
protected  ComparableResourcesPool requestedResourcesPool
          The pool of resources to apply the expression to.
 
Fields inherited from class org.apache.slide.search.basic.expression.BasicExpression
expressionElement, expressionFactory, resultSet
 
Constructor Summary
(package private) CompareExpression(org.jdom.Element e, ComparableResourcesPool requestedResourcesPool)
          Creates a compare expression according to Element e
 
Method Summary
protected abstract  boolean compare(ComparableResource item)
          The concrete CompareExpression must overwrite this.
 IBasicResultSet execute()
          Executes the expression.
 ComparableResourcesPool getRequestedResourcePool()
          Returns the RequestedResourcesPool to use.
 void setRequestedResourcePool(ComparableResourcesPool pool)
           
 
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, toString, wait, wait, wait
 

Field Detail

requestedResourcesPool

protected ComparableResourcesPool requestedResourcesPool
The pool of resources to apply the expression to.


propertyProvider

protected PropertyProvider propertyProvider
The PropertyProvider to use (may be null).

Constructor Detail

CompareExpression

CompareExpression(org.jdom.Element e,
                  ComparableResourcesPool requestedResourcesPool)
            throws InvalidQueryException
Creates a compare expression according to Element e

Parameters:
e - jdom element, that describes the expression
requestedResourcesPool - the pool of resources to apply the expression to.
Method Detail

execute

public IBasicResultSet execute()
                        throws SearchException
Executes the expression.

Returns:
a Set of RequestedResource objects
Throws:
SearchException

getRequestedResourcePool

public ComparableResourcesPool getRequestedResourcePool()
Returns the RequestedResourcesPool to use.

Returns:
the RequestedResourcesPool to use.

setRequestedResourcePool

public void setRequestedResourcePool(ComparableResourcesPool pool)
Specified by:
setRequestedResourcePool in class GenericBasicExpression

compare

protected abstract boolean compare(ComparableResource item)
The concrete CompareExpression must overwrite this.

Parameters:
item - one BasicDataItem out of pool
Returns:
a boolean