Class FilterCapabilities

Object
FilterCapabilities

public class FilterCapabilities extends Object
Represents the Filter capabilities that are supported by a SQLEncoder

Each 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 Details

    • NO_OP

      public static final long NO_OP
      Mask for no operation
      See Also:
    • NONE

      public static final long NONE
      Mask for Filter.INCLUDE
      See Also:
    • ALL

      public static final long ALL
      Mask for Filter.EXCLUDE
      See Also:
    • SPATIAL_BBOX

      public static final long SPATIAL_BBOX
      Spatial Mask for bbox operation
      See Also:
    • SPATIAL_EQUALS

      public static final long SPATIAL_EQUALS
      Spatial Mask for equals operation
      See Also:
    • SPATIAL_DISJOINT

      public static final long SPATIAL_DISJOINT
      Spatial Mask for disjoint operation
      See Also:
    • SPATIAL_INTERSECT

      public static final long SPATIAL_INTERSECT
      Spatial Mask for intersect operation
      See Also:
    • SPATIAL_TOUCHES

      public static final long SPATIAL_TOUCHES
      Spatial Mask for touches operation
      See Also:
    • SPATIAL_CROSSES

      public static final long SPATIAL_CROSSES
      Spatial Mask for crosses operation
      See Also:
    • SPATIAL_WITHIN

      public static final long SPATIAL_WITHIN
      Spatial Mask for within operation
      See Also:
    • SPATIAL_CONTAINS

      public static final long SPATIAL_CONTAINS
      Spatial Mask for contains operation
      See Also:
    • SPATIAL_OVERLAPS

      public static final long SPATIAL_OVERLAPS
      Spatial Mask for overlaps operation
      See Also:
    • SPATIAL_BEYOND

      public static final long SPATIAL_BEYOND
      Spatial Mask for beyond operation
      See Also:
    • SPATIAL_DWITHIN

      public static final long SPATIAL_DWITHIN
      Spatial Mask for dwithin operation
      See Also:
    • LIKE

      public static final long LIKE
      Scalar Mask for like operation
      See Also:
    • BETWEEN

      public static final long BETWEEN
      Scalar Mask for between opelongion
      See Also:
    • NULL_CHECK

      public static final long NULL_CHECK
      Scalar Mask for null check operation
      See Also:
    • SIMPLE_ARITHMETIC

      public static final long SIMPLE_ARITHMETIC
      Scalar Mask for simple arithmetic operations
      See Also:
    • FUNCTIONS

      public static final long FUNCTIONS
      Scalar Mask for function operations
      See Also:
    • COMPARE_EQUALS

      public static final long COMPARE_EQUALS
      See Also:
    • COMPARE_GREATER_THAN

      public static final long COMPARE_GREATER_THAN
      See Also:
    • COMPARE_GREATER_THAN_EQUAL

      public static final long COMPARE_GREATER_THAN_EQUAL
      See Also:
    • COMPARE_LESS_THAN

      public static final long COMPARE_LESS_THAN
      See Also:
    • COMPARE_LESS_THAN_EQUAL

      public static final long COMPARE_LESS_THAN_EQUAL
      See Also:
    • COMPARE_NOT_EQUALS

      public static final long COMPARE_NOT_EQUALS
      See Also:
    • FID

      public static final long FID
      See Also:
    • LOGIC_AND

      public static final long LOGIC_AND
      See Also:
    • LOGIC_NOT

      public static final long LOGIC_NOT
      See Also:
    • LOGIC_OR

      public static final long LOGIC_OR
      See Also:
    • LOGICAL

      public static final long LOGICAL
      Scalar Mask for logical operation
      See Also:
    • SIMPLE_COMPARISONS

      public static final long SIMPLE_COMPARISONS
      Scalar Mask for simple comparison operations
      See Also:
    • SIMPLE_COMPARISONS_OPENGIS

      public static final FilterCapabilities SIMPLE_COMPARISONS_OPENGIS
    • LOGICAL_OPENGIS

      public static final FilterCapabilities LOGICAL_OPENGIS
  • Constructor Details

    • FilterCapabilities

      public FilterCapabilities(long filterCapabilitiesType)
    • FilterCapabilities

      public FilterCapabilities()
    • FilterCapabilities

      public FilterCapabilities(Class type)
  • Method Details

    • 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 from FilterType
      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