org.geotools.filter
Class BinaryComparisonAbstract

Object
  extended by FilterAbstract
      extended by AbstractFilter
          extended by BinaryComparisonAbstract
All Implemented Interfaces:
FilterType, BinaryComparisonOperator, Filter, MultiValuedFilter
Direct Known Subclasses:
CompareFilterImpl, GeometryFilterImpl

public abstract class BinaryComparisonAbstract
extends AbstractFilter
implements BinaryComparisonOperator

Abstract implemention for binary filters.

Author:
Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org

Nested Class Summary
 
Nested classes/interfaces inherited from interface MultiValuedFilter
MultiValuedFilter.MatchAction
 
Field Summary
protected  Expression expression1
           
protected  Expression expression2
           
 
Fields inherited from class AbstractFilter
filterType, LOGGER, permissiveConstruction
 
Fields inherited from class FilterAbstract
factory
 
Fields inherited from interface Filter
EXCLUDE, INCLUDE
 
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
 
Constructor Summary
protected BinaryComparisonAbstract(FilterFactory factory)
           
protected BinaryComparisonAbstract(FilterFactory factory, Expression expression1, Expression expression2)
           
protected BinaryComparisonAbstract(FilterFactory factory, Expression expression1, Expression expression2, boolean matchingCase)
           
 
Method Summary
 Filter and(Filter filter)
          Implements a logical AND with this filter and returns the merged filter.
protected  Comparable comparable(Object value)
          Wraps an object in a Comparable.
protected  Object[] eval(Object object)
          Convenience method which evaluates the expressions and trys to align the values to be of the same type.
protected  Object[] eval(Object v1, Object v2)
          Convenience method which evaluates the expressions and trys to align the values to be of the same type.
 Expression getExpression1()
          Returns the first of the two expressions to be compared by this operator.
 Expression getExpression2()
          Returns the second of the two expressions to be compared by this operator.
 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?
 boolean isMatchingCase()
          Flag controlling wither comparisons are case sensitive.
 Filter not()
          Implements a logical NOT with this filter and returns the negated filter
 Filter or(Filter filter)
          Implements a logical OR with this filter and returns the merged filter.
 void setExpression1(Expression expression)
           
 void setExpression2(Expression expression)
           
 
Methods inherited from class AbstractFilter
accept, contains, getFilterType, isCompareFilter, isGeometryDistanceFilter, isGeometryFilter, isLogicFilter, isMathFilter, isSimpleFilter
 
Methods inherited from class FilterAbstract
accept, accepts, eval, eval, eval, evaluate
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Filter
accept, evaluate
 
Methods inherited from interface Filter
evaluate
 

Field Detail

expression1

protected Expression expression1

expression2

protected Expression expression2
Constructor Detail

BinaryComparisonAbstract

protected BinaryComparisonAbstract(FilterFactory factory)

BinaryComparisonAbstract

protected BinaryComparisonAbstract(FilterFactory factory,
                                   Expression expression1,
                                   Expression expression2)

BinaryComparisonAbstract

protected BinaryComparisonAbstract(FilterFactory factory,
                                   Expression expression1,
                                   Expression expression2,
                                   boolean matchingCase)
Method Detail

getExpression1

public Expression getExpression1()
Description copied from interface: BinaryComparisonOperator
Returns the first of the two expressions to be compared by this operator.

Specified by:
getExpression1 in interface BinaryComparisonOperator

setExpression1

public void setExpression1(Expression expression)

getExpression2

public Expression getExpression2()
Description copied from interface: BinaryComparisonOperator
Returns the second of the two expressions to be compared by this operator.

Specified by:
getExpression2 in interface BinaryComparisonOperator

setExpression2

public void setExpression2(Expression expression)

isMatchingCase

public boolean isMatchingCase()
Description copied from interface: BinaryComparisonOperator
Flag controlling wither comparisons are case sensitive.

Specified by:
isMatchingCase in interface BinaryComparisonOperator
Returns:
true if the comparison is case sensetive, otherwise false.

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
Returns:
MatchAction flag

and

public Filter and(Filter filter)
Description copied from interface: Filter
Implements a logical AND with this filter and returns the merged filter.

Parameters:
filter - The filter to AND with this filter.
Returns:
Combined filter.

or

public Filter or(Filter filter)
Description copied from interface: Filter
Implements a logical OR with this filter and returns the merged filter.

Parameters:
filter - The filter to OR with this filter.
Returns:
Combined filter.

not

public Filter not()
Description copied from interface: Filter
Implements a logical NOT with this filter and returns the negated filter

Returns:
Combined filter.

eval

protected Object[] eval(Object object)
Convenience method which evaluates the expressions and trys to align the values to be of the same type.

If the values can not be aligned, the original values are returned.

Returns:

eval

protected Object[] eval(Object v1,
                        Object v2)
Convenience method which evaluates the expressions and trys to align the values to be of the same type.

If the values can not be aligned, the original values are returned.

Returns:

comparable

protected final Comparable comparable(Object value)
Wraps an object in a Comparable.

Parameters:
value - The original value.
Returns:
A comparable


Copyright © 1996-2014 Geotools. All Rights Reserved.