Package org.geotools.filter
Class BinaryComparisonAbstract
- Object
-
- FilterAbstract
-
- AbstractFilter
-
- BinaryComparisonAbstract
-
- All Implemented Interfaces:
Filter
,MultiValuedFilter
,FilterType
- Direct Known Subclasses:
CompareFilterImpl
,GeometryFilterImpl
public abstract class BinaryComparisonAbstract extends AbstractFilter implements MultiValuedFilter
Abstract implementation for binary filters.This implementation gathers up expression1, expression2 and match action support.
For the SAX parsers setExpression1 and setExpression2 can be used to fill in the filter after creation. Everyone else is asked to treat the filter as immutable and use the appropriate FilterFactory creation method.
- Author:
- Justin Deoliveira (Boundless)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface MultiValuedFilter
MultiValuedFilter.MatchAction
-
-
Field Summary
Fields Modifier and Type Field Description protected Expression
expression1
protected Expression
expression2
-
Fields inherited from class AbstractFilter
LOGGER
-
Fields inherited from interface FilterType
ALL, 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, NONE, NULL
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BinaryComparisonAbstract()
No argument constructor for use by SAX parsers.protected
BinaryComparisonAbstract(Expression expression1, Expression expression2)
Immutable constructor for use by FilterFactoryprotected
BinaryComparisonAbstract(Expression expression1, Expression expression2, boolean matchingCase)
Immutable constructor for use by FilterFactory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
Expression
getExpression2()
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()
void
setExpression1(Expression expression)
void
setExpression2(Expression expression)
-
Methods inherited from class AbstractFilter
isCompareFilter, isGeometryDistanceFilter, isGeometryFilter, isLogicFilter, isMathFilter, isSimpleFilter
-
Methods inherited from class FilterAbstract
accepts, eval, eval
-
-
-
-
Field Detail
-
expression1
protected Expression expression1
-
expression2
protected Expression expression2
-
-
Constructor Detail
-
BinaryComparisonAbstract
protected BinaryComparisonAbstract()
No argument constructor for use by SAX parsers.
-
BinaryComparisonAbstract
protected BinaryComparisonAbstract(Expression expression1, Expression expression2)
Immutable constructor for use by FilterFactory
-
BinaryComparisonAbstract
protected BinaryComparisonAbstract(Expression expression1, Expression expression2, boolean matchingCase)
Immutable constructor for use by FilterFactory
-
-
Method Detail
-
getExpression1
public Expression getExpression1()
-
setExpression1
public void setExpression1(Expression expression)
-
getExpression2
public Expression getExpression2()
-
setExpression2
public void setExpression2(Expression expression)
-
isMatchingCase
public boolean isMatchingCase()
-
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 interfaceMultiValuedFilter
- Returns:
- MatchAction flag
-
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.
-
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.
-
comparable
protected final Comparable comparable(Object value)
Wraps an object in a Comparable.- Parameters:
value
- The original value.- Returns:
- A comparable
-
-