org.geotools.filter
Class AbstractFilter

java.lang.Object
  extended byorg.geotools.filter.FilterAbstract
      extended byorg.geotools.filter.AbstractFilter
All Implemented Interfaces:
Filter, org.opengis.filter.Filter, FilterType
Direct Known Subclasses:
AbstractFilterImpl, BinaryComparisonAbstract, BinaryLogicAbstract

public abstract class AbstractFilter
extends FilterAbstract
implements Filter

Implements Filter interface, with constants and default behaviors for methods.

Version:
$Id: AbstractFilter.java 18021 2006-02-14 20:36:18Z jdeolive $
Author:
Rob Hranac, Vision for New York

Field Summary
protected  short filterType
          Defines filter type (all valid types defined below).
protected static java.util.logging.Logger LOGGER
          The logger for the default core module.
protected  boolean permissiveConstruction
          Sets the permissiveness of the filter construction handling.
 
Fields inherited from interface org.geotools.filter.Filter
ALL, NONE
 
Fields inherited from interface org.geotools.filter.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 AbstractFilter(FilterFactory factory)
           
 
Method Summary
 void accept(FilterVisitor visitor)
          Deprecated. use Filter.accept(FilterVisitor, Object)
 boolean contains(Feature feature)
          Deprecated. use Filter.evaluate(Feature)
 boolean evaluate(java.lang.Object object)
          This method checks if the object is an instance of Feature and if so, calls through to Filter.evaluate(Feature).
 short getFilterType()
          Deprecated. The enumeration base type system is replaced with a class based type system. An 'instanceof' check should be made instead of calling this method.
protected static boolean isCompareFilter(short filterType)
          Checks to see if passed type is compare.
protected static boolean isGeometryDistanceFilter(short filterType)
          Checks to see if passed type is geometry distance type.
protected static boolean isGeometryFilter(short filterType)
          Checks to see if passed type is geometry.
protected static boolean isLogicFilter(short filterType)
          Checks to see if passed type is logic.
protected static boolean isMathFilter(short filterType)
          Checks to see if passed type is math.
protected static boolean isSimpleFilter(short filterType)
          Checks to see if passed type is logic.
 
Methods inherited from class org.geotools.filter.FilterAbstract
accept, accepts, comparable, eval, eval, evaluate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geotools.filter.Filter
and, evaluate, not, or
 
Methods inherited from interface org.opengis.filter.Filter
accept
 

Field Detail

LOGGER

protected static final java.util.logging.Logger LOGGER
The logger for the default core module.


filterType

protected short filterType
Defines filter type (all valid types defined below).


permissiveConstruction

protected boolean permissiveConstruction
Sets the permissiveness of the filter construction handling.

Constructor Detail

AbstractFilter

protected AbstractFilter(FilterFactory factory)
Parameters:
factory -
Method Detail

contains

public final boolean contains(Feature feature)
Deprecated. use Filter.evaluate(Feature)

Implements a 'contained by' check for a given feature, defaulting to true.

This calls through to FilterAbstract.evaluate(Feature).

Specified by:
contains in interface Filter
Parameters:
feature - Specified feature to examine.
Returns:
Result of 'contains' test.

evaluate

public boolean evaluate(java.lang.Object object)
This method checks if the object is an instance of Feature and if so, calls through to Filter.evaluate(Feature). This is done to maintain backwards compatability with previous version of Filter api which depended on Feature. If the object is not an instance of feature the super implementation is called.

Specified by:
evaluate in interface org.opengis.filter.Filter
Overrides:
evaluate in class FilterAbstract

isLogicFilter

protected static boolean isLogicFilter(short filterType)
Checks to see if passed type is logic.

Parameters:
filterType - Type of filter for check.
Returns:
Whether or not this is a logic filter type.

isMathFilter

protected static boolean isMathFilter(short filterType)
Checks to see if passed type is math.

Parameters:
filterType - Type of filter for check.
Returns:
Whether or not this is a math filter type.

isCompareFilter

protected static boolean isCompareFilter(short filterType)
Checks to see if passed type is compare.

Parameters:
filterType - Type of filter for check.
Returns:
Whether or not this is a compare filter type.

isGeometryFilter

protected static boolean isGeometryFilter(short filterType)
Checks to see if passed type is geometry.

Parameters:
filterType - Type of filter for check.
Returns:
Whether or not this is a geometry filter type.

isGeometryDistanceFilter

protected static boolean isGeometryDistanceFilter(short filterType)
Checks to see if passed type is geometry distance type.

Parameters:
filterType - Type of filter for check.
Returns:
Whether or not this is a geometry filter type.

isSimpleFilter

protected static boolean isSimpleFilter(short filterType)
Checks to see if passed type is logic.

Parameters:
filterType - Type of filter for check.
Returns:
Whether or not this is a logic filter type.

getFilterType

public short getFilterType()
Deprecated. The enumeration base type system is replaced with a class based type system. An 'instanceof' check should be made instead of calling this method.

Retrieves the type of filter.

Specified by:
getFilterType in interface Filter
Returns:
a short representation of the filter type.

accept

public final void accept(FilterVisitor visitor)
Deprecated. use Filter.accept(FilterVisitor, Object)

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
Parameters:
visitor - The visitor which requires access to this filter, the method must call visitor.visit(this);


Copyright © GeoTools. All Rights Reserved.