org.geotools.filter
Class IsBetweenImpl

Object
  extended by FilterAbstract
      extended by AbstractFilter
          extended by BinaryComparisonAbstract
              extended by CompareFilterImpl
                  extended by IsBetweenImpl
All Implemented Interfaces:
BetweenFilter, CompareFilter, FilterType, BinaryComparisonOperator, Filter, MultiValuedFilter, PropertyIsBetween

public class IsBetweenImpl
extends CompareFilterImpl
implements BetweenFilter

Straight implementation of GeoAPI interface.

Author:
Justin Deoliveira, The Open Planning Project

Nested Class Summary
 
Nested classes/interfaces inherited from interface MultiValuedFilter
MultiValuedFilter.MatchAction
 
Field Summary
protected  MultiValuedFilter.MatchAction matchAction
           
 
Fields inherited from class BinaryComparisonAbstract
expression1, expression2
 
Fields inherited from class AbstractFilter
filterType, permissiveConstruction
 
Fields inherited from class FilterAbstract
factory
 
Fields inherited from interface Filter
ALL, NONE
 
Fields inherited from interface 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 Filter
EXCLUDE, INCLUDE
 
Fields inherited from interface PropertyIsBetween
NAME
 
Constructor Summary
protected IsBetweenImpl(FilterFactory factory, Expression lower, Expression expression, Expression upper)
           
protected IsBetweenImpl(FilterFactory factory, Expression lower, Expression expression, Expression upper, MultiValuedFilter.MatchAction matchAction)
           
 
Method Summary
 Object accept(FilterVisitor visitor, Object extraData)
          Used by FilterVisitors to perform some action on this filter instance.
 void addMiddleValue(Expression middleValue)
          Deprecated. use setExpression(Expression)
 boolean evaluate(Object feature)
          Give an object, this method determines if the test(s) represented by this filter object are passed.
 boolean evaluateInternal(Object value, Object lower, Object upper)
           
 Expression getExpression()
          Returns the expression to be compared by this operator.
 Expression getLowerBoundary()
          Returns the lower bounds (inclusive) an an expression.
 MultiValuedFilter.MatchAction getMatchAction()
          Flag Controlling MatchAction property When one or more of the operands evaluates to multiple values rather than a single value, which action should be taken?
 Expression getMiddleValue()
          Deprecated. use getExpression()
 Expression getUpperBoundary()
          Returns the upper bounds (inclusive) as an expression.
 void setExpression(Expression expression)
           
 void setLowerBoundary(Expression lowerBoundary)
           
 void setUpperBoundary(Expression upperBoundary)
           
 String toString()
          Returns a string representation of this filter.
 
Methods inherited from class CompareFilterImpl
addLeftValue, addRightValue, compare, equals, evaluate, getLeftValue, getRightValue, hashCode, setExpression1, setExpression2
 
Methods inherited from class BinaryComparisonAbstract
and, comparable, eval, eval, getExpression1, getExpression2, isMatchingCase, not, or
 
Methods inherited from class AbstractFilter
accept, contains, getFilterType, isCompareFilter, isGeometryDistanceFilter, isGeometryFilter, isLogicFilter, isMathFilter, isSimpleFilter
 
Methods inherited from class FilterAbstract
accepts, eval, eval, eval
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface BetweenFilter
contains, getExpression1, getExpression2, setExpression1, setExpression2
 
Methods inherited from interface CompareFilter
addLeftValue, addRightValue, getLeftValue, getRightValue
 
Methods inherited from interface Filter
accept, and, evaluate, getFilterType, not, or
 
Methods inherited from interface BinaryComparisonOperator
isMatchingCase
 

Field Detail

matchAction

protected MultiValuedFilter.MatchAction matchAction
Constructor Detail

IsBetweenImpl

protected IsBetweenImpl(FilterFactory factory,
                        Expression lower,
                        Expression expression,
                        Expression upper,
                        MultiValuedFilter.MatchAction matchAction)

IsBetweenImpl

protected IsBetweenImpl(FilterFactory factory,
                        Expression lower,
                        Expression expression,
                        Expression upper)
Method Detail

getExpression

public Expression getExpression()
Description copied from interface: PropertyIsBetween
Returns the expression to be compared by this operator.

Specified by:
getExpression in interface PropertyIsBetween

setExpression

public void setExpression(Expression expression)

getMatchAction

public MultiValuedFilter.MatchAction getMatchAction()
Description copied from interface: MultiValuedFilter
Flag Controlling MatchAction property When one or more of the operands evaluates to multiple values rather than a single value, which action should be taken? If there are n values for the left operand and m values for the right operand, there are n * m possible combinations that can be compared, ANY - if any of the possible combinations match, the result is true (aggregated OR) ALL - only if all of the possible combinations match, the result is true (aggregated AND) ONE - only if exactly one of the possible combinations match, the result is true (aggregated XOR)

Specified by:
getMatchAction in interface MultiValuedFilter
Overrides:
getMatchAction in class BinaryComparisonAbstract
Returns:
MatchAction flag

evaluate

public boolean evaluate(Object feature)
Description copied from interface: Filter
Give an object, this method determines if the test(s) represented by this filter object are passed.

This ability is used to allow Queries against both Features and and non spatial data (such as Record) and to express constraints on permissable data values.

Specified by:
evaluate in interface Filter
Returns:
true if the test(s) are passed for the provided object

evaluateInternal

public boolean evaluateInternal(Object value,
                                Object lower,
                                Object upper)

accept

public Object accept(FilterVisitor visitor,
                     Object extraData)
Description copied from class: CompareFilterImpl
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 Filter
Specified by:
accept in class CompareFilterImpl
Parameters:
visitor - The visitor which requires access to this filter, the method must call visitor.visit(this);

getLowerBoundary

public Expression getLowerBoundary()
Description copied from interface: PropertyIsBetween
Returns the lower bounds (inclusive) an an expression.

Specified by:
getLowerBoundary in interface PropertyIsBetween

setLowerBoundary

public void setLowerBoundary(Expression lowerBoundary)

getUpperBoundary

public Expression getUpperBoundary()
Description copied from interface: PropertyIsBetween
Returns the upper bounds (inclusive) as an expression.

Specified by:
getUpperBoundary in interface PropertyIsBetween

setUpperBoundary

public void setUpperBoundary(Expression upperBoundary)

getMiddleValue

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

Description copied from interface: BetweenFilter
Gets the middle value of the between. Should generally be an AttributeExpression: 1 <= area <= 200 makes sense, 1 <= 200 <= area should just use a less-than-or-equal filter.

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

addMiddleValue

public void addMiddleValue(Expression middleValue)
Deprecated. use setExpression(Expression)

Description copied from interface: BetweenFilter
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.

toString

public String toString()
Description copied from class: CompareFilterImpl
Returns a string representation of this filter.

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


Copyright © 1996-2014 Geotools. All Rights Reserved.