Package org.geotools.filter
Class FilterCapabilities
- Object
-
- FilterCapabilities
-
public class FilterCapabilities extends Object
Represents the Filter capabilities that are supported by a SQLEncoderEach SQLEncoder class should have one static FilterCapabilities, representing the filter encoding operations that it can successfully perform.
This class is used as one big mask to detect filters that cannot be performed
- Author:
- Chris Holmes, TOPP TODO: check if possible to deprecate @ deprecated use
FilterCapabilities
.
-
-
Field Summary
Fields Modifier and Type Field Description static long
ALL
Mask for Filter.EXCLUDEstatic long
BETWEEN
Scalar Mask for between opelongionstatic long
COMPARE_EQUALS
static long
COMPARE_GREATER_THAN
static long
COMPARE_GREATER_THAN_EQUAL
static long
COMPARE_LESS_THAN
static long
COMPARE_LESS_THAN_EQUAL
static long
COMPARE_NOT_EQUALS
static long
FID
static long
FUNCTIONS
Scalar Mask for function operationsstatic long
LIKE
Scalar Mask for like operationstatic long
LOGIC_AND
static long
LOGIC_NOT
static long
LOGIC_OR
static long
LOGICAL
Scalar Mask for logical operationstatic FilterCapabilities
LOGICAL_OPENGIS
static long
NO_OP
Mask for no operationstatic long
NONE
Mask for Filter.INCLUDEstatic long
NULL_CHECK
Scalar Mask for null check operationstatic long
SIMPLE_ARITHMETIC
Scalar Mask for simple arithmetic operationsstatic long
SIMPLE_COMPARISONS
Scalar Mask for simple comparison operationsstatic FilterCapabilities
SIMPLE_COMPARISONS_OPENGIS
static long
SPATIAL_BBOX
Spatial Mask for bbox operationstatic long
SPATIAL_BEYOND
Spatial Mask for beyond operationstatic long
SPATIAL_CONTAINS
Spatial Mask for contains operationstatic long
SPATIAL_CROSSES
Spatial Mask for crosses operationstatic long
SPATIAL_DISJOINT
Spatial Mask for disjoint operationstatic long
SPATIAL_DWITHIN
Spatial Mask for dwithin operationstatic long
SPATIAL_EQUALS
Spatial Mask for equals operationstatic long
SPATIAL_INTERSECT
Spatial Mask for intersect operationstatic long
SPATIAL_OVERLAPS
Spatial Mask for overlaps operationstatic long
SPATIAL_TOUCHES
Spatial Mask for touches operationstatic long
SPATIAL_WITHIN
Spatial Mask for within operation
-
Constructor Summary
Constructors Constructor Description FilterCapabilities()
FilterCapabilities(long filterCapabilitiesType)
FilterCapabilities(Class type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(FilterCapabilities capabilities)
Add all the capabilities in the provided FilterCapabilities to this capabilities.void
addType(long type)
Adds a new support type to capabilities.void
addType(Class type)
Adds a new support type to capabilities.void
addType(Class type, boolean addFunctionType)
Adds a new support type to capabilities.FilterCapabilities
convertFilterTypeToMask(short type)
Returns the mask that is equivalent to the FilterType constant.static FilterCapabilities
findFunction(String name)
Translates a String into an object that represents function expressionstatic FilterCapabilities
findOperation(String name)
Translates a String into an object that represents the operationboolean
fullySupports(Filter filter)
Determines if the filter and all its sub filters are supported.long
getScalarOps()
long
getSpatialOps()
boolean
supports(Class type)
boolean
supports(Filter filter)
Determines if the filter passed in is supported.boolean
supports(FilterCapabilities type)
-
-
-
Field Detail
-
NO_OP
public static final long NO_OP
Mask for no operation- See Also:
- Constant Field Values
-
NONE
public static final long NONE
Mask for Filter.INCLUDE- See Also:
- Constant Field Values
-
ALL
public static final long ALL
Mask for Filter.EXCLUDE- See Also:
- Constant Field Values
-
SPATIAL_BBOX
public static final long SPATIAL_BBOX
Spatial Mask for bbox operation- See Also:
- Constant Field Values
-
SPATIAL_EQUALS
public static final long SPATIAL_EQUALS
Spatial Mask for equals operation- See Also:
- Constant Field Values
-
SPATIAL_DISJOINT
public static final long SPATIAL_DISJOINT
Spatial Mask for disjoint operation- See Also:
- Constant Field Values
-
SPATIAL_INTERSECT
public static final long SPATIAL_INTERSECT
Spatial Mask for intersect operation- See Also:
- Constant Field Values
-
SPATIAL_TOUCHES
public static final long SPATIAL_TOUCHES
Spatial Mask for touches operation- See Also:
- Constant Field Values
-
SPATIAL_CROSSES
public static final long SPATIAL_CROSSES
Spatial Mask for crosses operation- See Also:
- Constant Field Values
-
SPATIAL_WITHIN
public static final long SPATIAL_WITHIN
Spatial Mask for within operation- See Also:
- Constant Field Values
-
SPATIAL_CONTAINS
public static final long SPATIAL_CONTAINS
Spatial Mask for contains operation- See Also:
- Constant Field Values
-
SPATIAL_OVERLAPS
public static final long SPATIAL_OVERLAPS
Spatial Mask for overlaps operation- See Also:
- Constant Field Values
-
SPATIAL_BEYOND
public static final long SPATIAL_BEYOND
Spatial Mask for beyond operation- See Also:
- Constant Field Values
-
SPATIAL_DWITHIN
public static final long SPATIAL_DWITHIN
Spatial Mask for dwithin operation- See Also:
- Constant Field Values
-
LIKE
public static final long LIKE
Scalar Mask for like operation- See Also:
- Constant Field Values
-
BETWEEN
public static final long BETWEEN
Scalar Mask for between opelongion- See Also:
- Constant Field Values
-
NULL_CHECK
public static final long NULL_CHECK
Scalar Mask for null check operation- See Also:
- Constant Field Values
-
SIMPLE_ARITHMETIC
public static final long SIMPLE_ARITHMETIC
Scalar Mask for simple arithmetic operations- See Also:
- Constant Field Values
-
FUNCTIONS
public static final long FUNCTIONS
Scalar Mask for function operations- See Also:
- Constant Field Values
-
COMPARE_EQUALS
public static final long COMPARE_EQUALS
- See Also:
- Constant Field Values
-
COMPARE_GREATER_THAN
public static final long COMPARE_GREATER_THAN
- See Also:
- Constant Field Values
-
COMPARE_GREATER_THAN_EQUAL
public static final long COMPARE_GREATER_THAN_EQUAL
- See Also:
- Constant Field Values
-
COMPARE_LESS_THAN
public static final long COMPARE_LESS_THAN
- See Also:
- Constant Field Values
-
COMPARE_LESS_THAN_EQUAL
public static final long COMPARE_LESS_THAN_EQUAL
- See Also:
- Constant Field Values
-
COMPARE_NOT_EQUALS
public static final long COMPARE_NOT_EQUALS
- See Also:
- Constant Field Values
-
FID
public static final long FID
- See Also:
- Constant Field Values
-
LOGIC_AND
public static final long LOGIC_AND
- See Also:
- Constant Field Values
-
LOGIC_NOT
public static final long LOGIC_NOT
- See Also:
- Constant Field Values
-
LOGIC_OR
public static final long LOGIC_OR
- See Also:
- Constant Field Values
-
LOGICAL
public static final long LOGICAL
Scalar Mask for logical operation- See Also:
- Constant Field Values
-
SIMPLE_COMPARISONS
public static final long SIMPLE_COMPARISONS
Scalar Mask for simple comparison operations- See Also:
- Constant Field Values
-
SIMPLE_COMPARISONS_OPENGIS
public static final FilterCapabilities SIMPLE_COMPARISONS_OPENGIS
-
LOGICAL_OPENGIS
public static final FilterCapabilities LOGICAL_OPENGIS
-
-
Constructor Detail
-
FilterCapabilities
public FilterCapabilities(long filterCapabilitiesType)
-
FilterCapabilities
public FilterCapabilities()
-
FilterCapabilities
public FilterCapabilities(Class type)
-
-
Method Detail
-
addType
public void addType(long type)
Adds a new support type to capabilities.- Parameters:
type
- The one of the masks enumerated in this class
-
addType
public void addType(Class type)
Adds a new support type to capabilities. For 2.2 only function expression support is added this way. As of geotools 2.3 this will be the supported way of adding to Filtercapabilities.- Parameters:
type
- the Class that indicates the new support.
-
addType
public void addType(Class type, boolean addFunctionType)
Adds a new support type to capabilities. For 2.2 only function expression support is added this way. As of geotools 2.3 this will be the supported way of adding to Filtercapabilities.- Parameters:
type
- the Class that indicates the new support.
-
addAll
public void addAll(FilterCapabilities capabilities)
Add all the capabilities in the provided FilterCapabilities to this capabilities.- Parameters:
capabilities
- capabilities to add.
-
convertFilterTypeToMask
public FilterCapabilities convertFilterTypeToMask(short type)
Returns the mask that is equivalent to the FilterType constant.- Parameters:
type
- a constant fromFilterType
- Returns:
- the mask that is equivalent to the FilterType constant.
-
supports
public boolean supports(Filter filter)
Determines if the filter passed in is supported.- Parameters:
filter
- The Filter to be tested.- Returns:
- true if supported, false otherwise.
-
fullySupports
public boolean fullySupports(Filter filter)
Determines if the filter and all its sub filters are supported. Is most important for logic filters, as they are the only ones with subFilters. Null filters should not be used here, if nothing should be filtered than Filter.INCLUDE can be used. Embedded nulls can be a particular source of problems, buried in logic filters.- Parameters:
filter
- the filter to be tested.- Returns:
- true if all sub filters are supported, false otherwise.
- Throws:
IllegalArgumentException
- If a null filter is passed in. As this function is recursive a null in a logic filter will also cause an error.
-
supports
public boolean supports(FilterCapabilities type)
-
supports
public boolean supports(Class type)
-
getScalarOps
public long getScalarOps()
-
getSpatialOps
public long getSpatialOps()
-
findOperation
public static FilterCapabilities findOperation(String name)
Translates a String into an object that represents the operation- Parameters:
name
- String, operation name- Returns:
- one of the
FilterCapabilities
constants
-
findFunction
public static FilterCapabilities findFunction(String name)
Translates a String into an object that represents function expression- Parameters:
name
- String, expression name- Returns:
- one of the
FilterCapabilities
constants
-
-