org.geotools.filter
Interface CompareFilter

All Superinterfaces:
Filter, FilterType
All Known Subinterfaces:
BetweenFilter
All Known Implementing Classes:
BetweenFilterImpl, CompareFilterImpl

public interface CompareFilter
extends Filter

Defines a comparison filter (can be a math comparison or generic equals). This filter implements a comparison - of some sort - between two expressions. The comparison may be a math comparison or a generic equals comparison. If it is a math comparison, only math expressions are allowed; if it is an equals comparison, any expression types are allowed. Note that this comparison does not attempt to restrict its expressions to be meaningful. This means that it considers itself a valid filter as long as the expression comparison returns a valid result. It does no checking to see whether or not the expression comparison is meaningful with regard to checking feature attributes. In other words, this is a valid filter: 52 = 92, even though it will always return the same result and could be simplified away. It is up the the filter creator, therefore, to attempt to simplify/make meaningful filter logic.

Version:
$Id: CompareFilter.java,v 1.3 2003/08/07 19:55:21 cholmesny Exp $
Author:
Rob Hranac, Vision for New York

Field Summary
 
Fields inherited from interface org.geotools.filter.Filter
ALL, NONE
 
Fields inherited from interface org.geotools.filter.FilterType
BETWEEN, COMPARE_EQUALS, COMPARE_GREATER_THAN, COMPARE_GREATER_THAN_EQUAL, COMPARE_LESS_THAN, COMPARE_LESS_THAN_EQUAL, COMPARE_NOT_EQUALS, FID, GEOMETRY_BBOX, GEOMETRY_BEYOND, GEOMETRY_CONTAINS, GEOMETRY_CROSSES, GEOMETRY_DISJOINT, GEOMETRY_DWITHIN, GEOMETRY_EQUALS, GEOMETRY_INTERSECTS, GEOMETRY_OVERLAPS, GEOMETRY_TOUCHES, GEOMETRY_WITHIN, LIKE, LOGIC_AND, LOGIC_NOT, LOGIC_OR, NULL
 
Method Summary
 void addLeftValue(Expression leftValue)
          Adds the 'left' value to this filter.
 void addRightValue(Expression rightValue)
          Adds the 'right' value to this filter.
 boolean contains(Feature feature)
          Determines whether or not a given feature is 'inside' this filter.
 Expression getLeftValue()
          Gets the left expression.
 Expression getRightValue()
          Gets the right expression.
 
Methods inherited from interface org.geotools.filter.Filter
accept, and, getFilterType, not, or
 

Method Detail

addLeftValue

public void addLeftValue(Expression leftValue)
                  throws IllegalFilterException
Adds the 'left' value to this filter.

Parameters:
leftValue - Expression for 'left' value.
Throws:
IllegalFilterException - Filter is not internally consistent.
Task:
REVISIT: immutability?

addRightValue

public void addRightValue(Expression rightValue)
                   throws IllegalFilterException
Adds the 'right' value to this filter.

Parameters:
rightValue - Expression for 'right' value.
Throws:
IllegalFilterException - Filter is not internally consistent.
Task:
REVISIT: make immutable.

getLeftValue

public Expression getLeftValue()
Gets the left expression.

Returns:
The expression on the left of the comparison.

getRightValue

public Expression getRightValue()
Gets the right expression.

Returns:
The expression on the right of the comparison.

contains

public boolean contains(Feature feature)
Determines whether or not a given feature is 'inside' this filter.

Specified by:
contains in interface Filter
Parameters:
feature - Specified feature to examine.
Returns:
Whether or not this feature is inside the filter.


Copyright © GeoTools. All Rights Reserved.