org.geotools.filter
Class FilterAbstract

java.lang.Object
  extended byorg.geotools.filter.FilterAbstract
All Implemented Interfaces:
org.opengis.filter.Filter
Direct Known Subclasses:
AbstractFilter, IsBetweenImpl, IsNullImpl

public class FilterAbstract
extends java.lang.Object
implements org.opengis.filter.Filter

Abstract implementation for Filter.

Author:
Jody Garnett

Constructor Summary
protected FilterAbstract(FilterFactory factory)
           
 
Method Summary
 java.lang.Object accept(org.opengis.filter.FilterVisitor visitor, java.lang.Object extraData)
          Subclass should override, default implementation just returns extraData
 boolean accepts(Feature feature)
          Straight call throught to: evaulate( feature )
protected  java.lang.Comparable comparable(org.opengis.filter.expression.Expression expr, Feature feature)
          Subclass convenience method for turning an expression + feature into something comparable.
protected  java.lang.Object eval(Expression expression, Feature feature)
          Helper method for subclasses to reduce null checks
protected  java.lang.Object eval(org.opengis.filter.expression.Expression expression, java.lang.Object object)
          Helper method for subclasses to reduce null checks
 boolean evaluate(Feature feature)
          Subclass should overrride.
 boolean evaluate(java.lang.Object object)
          Subclass should overrride.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterAbstract

protected FilterAbstract(FilterFactory factory)
Parameters:
factory - FilterFactory injected into the filter.
Method Detail

evaluate

public boolean evaluate(Feature feature)
Subclass should overrride. Default value is false


evaluate

public boolean evaluate(java.lang.Object object)
Subclass should overrride. Default value is false

Specified by:
evaluate in interface org.opengis.filter.Filter

accepts

public boolean accepts(Feature feature)
Straight call throught to: evaulate( feature )


accept

public java.lang.Object accept(org.opengis.filter.FilterVisitor visitor,
                               java.lang.Object extraData)
Subclass should override, default implementation just returns extraData

Specified by:
accept in interface org.opengis.filter.Filter

eval

protected java.lang.Object eval(Expression expression,
                                Feature feature)
Helper method for subclasses to reduce null checks

Parameters:
expression -
feature -
Returns:
value or null

eval

protected java.lang.Object eval(org.opengis.filter.expression.Expression expression,
                                java.lang.Object object)
Helper method for subclasses to reduce null checks

Parameters:
expression -
object -
Returns:
value or null

comparable

protected java.lang.Comparable comparable(org.opengis.filter.expression.Expression expr,
                                          Feature feature)
Subclass convenience method for turning an expression + feature into something comparable.

If the result of the expression is something that implements Comparable it is returned directly, otherwise the object is transformed to a string and returned.

Parameters:
expr - The expression
feature - The feature.
Returns:
Something comparable.


Copyright © GeoTools. All Rights Reserved.