org.geotools.filter
Class BetweenFilterImpl

java.lang.Object
  extended by org.geotools.filter.FilterAbstract
      extended by org.geotools.filter.AbstractFilter
          extended by org.geotools.filter.BinaryComparisonAbstract
              extended by org.geotools.filter.CompareFilterImpl
                  extended by org.geotools.filter.BetweenFilterImpl
All Implemented Interfaces:
BetweenFilter, CompareFilter, FilterType, org.opengis.filter.BinaryComparisonOperator, org.opengis.filter.Filter, org.opengis.filter.PropertyIsBetween

Deprecated. use IsBetweenImpl

public class BetweenFilterImpl
extends CompareFilterImpl
implements BetweenFilter

Defines a 'between' filter (which is a specialized compare filter). A between filter is just shorthand for a less-than-or-equal filter ANDed with a greater-than-or-equal filter. Arguably, this would be better handled using those constructs, but the OGC filter specification creates its own object for this, so we do as well. An important note here is that a between filter is actually a math filter, so its outer (left and right) expressions must be math expressions. This is enforced by the FilterAbstract class, which considers a BETWEEN operator to be a math filter.

Version:
$Id: BetweenFilterImpl.java 31681 2008-10-18 19:02:26Z aaime $
Author:
Rob Hranac, TOPP

Field Summary
protected  org.opengis.filter.expression.Expression middleValue
          Deprecated. The 'middle' value, which must be an attribute expression.
 
Fields inherited from class org.geotools.filter.BinaryComparisonAbstract
expression1, expression2
 
Fields inherited from class org.geotools.filter.AbstractFilter
filterType, permissiveConstruction
 
Fields inherited from class org.geotools.filter.FilterAbstract
factory
 
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
 
Fields inherited from interface org.opengis.filter.Filter
EXCLUDE, INCLUDE
 
Fields inherited from interface org.opengis.filter.PropertyIsBetween
NAME
 
Constructor Summary
protected BetweenFilterImpl()
          Deprecated. Constructor which flags the operator as between.
protected BetweenFilterImpl(org.opengis.filter.FilterFactory factory)
          Deprecated.  
 
Method Summary
 java.lang.Object accept(org.opengis.filter.FilterVisitor visitor, java.lang.Object extraData)
          Deprecated. Used by FilterVisitors to perform some action on this filter instance.
 void addMiddleValue(Expression middleValue)
          Deprecated. use setExpression(org.opengis.filter.expression.Expression)
 boolean equals(java.lang.Object oFilter)
          Deprecated. Returns true if the passed in object is the same as this filter.
 boolean evaluate(java.lang.Object feature)
          Deprecated. Determines whether or not a given feature is 'inside' this filter.
 org.opengis.filter.expression.Expression getExpression()
          Deprecated. Gets the middle value of the between.
 org.opengis.filter.expression.Expression getLowerBoundary()
          Deprecated. Returns the left,lower, or first expression.
 Expression getMiddleValue()
          Deprecated. use getExpression()
 org.opengis.filter.expression.Expression getUpperBoundary()
          Deprecated. Returns the right,upper, or second expression.
 int hashCode()
          Deprecated. Override of hashCode method.
 void setExpression(org.opengis.filter.expression.Expression expression)
          Deprecated. Sets the expression or middle value.
 void setLowerBoundary(org.opengis.filter.expression.Expression lowerBounds)
          Deprecated. Sets the left,lower, or first expression.
 void setUpperBoundary(org.opengis.filter.expression.Expression upperBounds)
          Deprecated. Sets the right,upper, or second expression.
 java.lang.String toString()
          Deprecated. Returns a string representation of this filter.
 
Methods inherited from class org.geotools.filter.CompareFilterImpl
addLeftValue, addRightValue, compare, evaluate, getLeftValue, getRightValue, setExpression1, setExpression2
 
Methods inherited from class org.geotools.filter.BinaryComparisonAbstract
and, comparable, eval, getExpression1, getExpression2, isMatchingCase, not, or
 
Methods inherited from class org.geotools.filter.AbstractFilter
accept, contains, getFilterType, isCompareFilter, isGeometryDistanceFilter, isGeometryFilter, isLogicFilter, isMathFilter, isSimpleFilter
 
Methods inherited from class org.geotools.filter.FilterAbstract
accepts, eval, eval, eval
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.filter.BetweenFilter
contains, getExpression1, getExpression2, setExpression1, setExpression2
 
Methods inherited from interface org.geotools.filter.CompareFilter
addLeftValue, addRightValue, getLeftValue, getRightValue
 
Methods inherited from interface org.geotools.filter.Filter
accept, and, evaluate, getFilterType, not, or
 
Methods inherited from interface org.opengis.filter.BinaryComparisonOperator
isMatchingCase
 

Field Detail

middleValue

protected org.opengis.filter.expression.Expression middleValue
Deprecated. 
The 'middle' value, which must be an attribute expression.

Constructor Detail

BetweenFilterImpl

protected BetweenFilterImpl(org.opengis.filter.FilterFactory factory)
Deprecated. 

BetweenFilterImpl

protected BetweenFilterImpl()
                     throws IllegalFilterException
Deprecated. 
Constructor which flags the operator as between.

Throws:
IllegalFilterException - Should never happen.
Method Detail

addMiddleValue

public final void addMiddleValue(Expression middleValue)
Deprecated. use setExpression(org.opengis.filter.expression.Expression)

Sets the values to be compared as between the left and right values.

Specified by:
addMiddleValue in interface BetweenFilter
Parameters:
middleValue - The expression to be compared.

setExpression

public void setExpression(org.opengis.filter.expression.Expression expression)
Deprecated. 
Sets the expression or middle value.


getMiddleValue

public final Expression getMiddleValue()
Deprecated. use getExpression()

Gets the middle value of the between.

Specified by:
getMiddleValue in interface BetweenFilter
Returns:
The expression in the middle.

getExpression

public org.opengis.filter.expression.Expression getExpression()
Deprecated. 
Gets the middle value of the between.

Specified by:
getExpression in interface org.opengis.filter.PropertyIsBetween
Returns:
The expression in the middle.

getLowerBoundary

public org.opengis.filter.expression.Expression getLowerBoundary()
Deprecated. 
Returns the left,lower, or first expression.

Specified by:
getLowerBoundary in interface org.opengis.filter.PropertyIsBetween

setLowerBoundary

public void setLowerBoundary(org.opengis.filter.expression.Expression lowerBounds)
Deprecated. 
Sets the left,lower, or first expression.


getUpperBoundary

public org.opengis.filter.expression.Expression getUpperBoundary()
Deprecated. 
Returns the right,upper, or second expression.

Specified by:
getUpperBoundary in interface org.opengis.filter.PropertyIsBetween

setUpperBoundary

public void setUpperBoundary(org.opengis.filter.expression.Expression upperBounds)
Deprecated. 
Sets the right,upper, or second expression.


evaluate

public boolean evaluate(java.lang.Object feature)
Deprecated. 
Determines whether or not a given feature is 'inside' this filter.

Specified by:
evaluate in interface org.opengis.filter.Filter
Parameters:
feature - Specified feature to examine.
Returns:
Flag confirming whether or not this feature is inside the filter.

toString

public java.lang.String toString()
Deprecated. 
Returns a string representation of this filter.

Overrides:
toString in class CompareFilterImpl
Returns:
String representation of the between filter.

equals

public boolean equals(java.lang.Object oFilter)
Deprecated. 
Returns true if the passed in object is the same as this filter. Checks to make sure the filter types are the same as well as all three of the values.

Overrides:
equals in class CompareFilterImpl
Parameters:
oFilter - the filter to test for eqaulity.
Returns:
True if the objects are equal.

hashCode

public int hashCode()
Deprecated. 
Override of hashCode method.

Overrides:
hashCode in class CompareFilterImpl
Returns:
a code to hash this filter by.

accept

public java.lang.Object accept(org.opengis.filter.FilterVisitor visitor,
                               java.lang.Object extraData)
Deprecated. 
Used by FilterVisitors to perform some action on this filter instance. Typicaly used by Filter decoders, but may also be used by any thing which needs infomration from filter structure. Implementations should always call: visitor.visit(this); It is importatant that this is not left to a parent class unless the parents API is identical.

Specified by:
accept in interface org.opengis.filter.Filter
Specified by:
accept in class CompareFilterImpl
Parameters:
visitor - The visitor which requires access to this filter, the method must call visitor.visit(this);


Copyright © 1996-2010 Geotools. All Rights Reserved.