org.geotools.filter
Interface CompareFilter

All Superinterfaces:
org.opengis.filter.BinaryComparisonOperator, Filter, org.opengis.filter.Filter, FilterType
All Known Subinterfaces:
BetweenFilter
All Known Implementing Classes:
BetweenFilterImpl, CompareFilterImpl

public interface CompareFilter
extends Filter, org.opengis.filter.BinaryComparisonOperator

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 18021 2006-02-14 20:36:18Z jdeolive $
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)
          Deprecated. use BinaryComparisonOperator.setExpression1(Expression)
 void addRightValue(Expression rightValue)
          Deprecated. use BinaryComparisonOperator.setExpression2(Expression)
 boolean contains(Feature feature)
          Deprecated. use org.opengis.filter.Filter#evaluate(Feature)
 Expression getLeftValue()
          Deprecated. use BinaryComparisonOperator.getExpression1()
 Expression getRightValue()
          Deprecated. use BinaryComparisonOperator.getExpression2()
 
Methods inherited from interface org.geotools.filter.Filter
accept, and, evaluate, getFilterType, not, or
 
Methods inherited from interface org.opengis.filter.Filter
accept, evaluate
 
Methods inherited from interface org.opengis.filter.BinaryComparisonOperator
getExpression1, getExpression2, setExpression1, setExpression2
 

Method Detail

addLeftValue

public void addLeftValue(Expression leftValue)
                  throws IllegalFilterException
Deprecated. use BinaryComparisonOperator.setExpression1(Expression)

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
Deprecated. use BinaryComparisonOperator.setExpression2(Expression)

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()
Deprecated. use BinaryComparisonOperator.getExpression1()

Gets the left expression.

Returns:
The expression on the left of the comparison.

getRightValue

public Expression getRightValue()
Deprecated. use BinaryComparisonOperator.getExpression2()

Gets the right expression.

Returns:
The expression on the right of the comparison.

contains

public boolean contains(Feature feature)
Deprecated. use org.opengis.filter.Filter#evaluate(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.