|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines an OpenGIS Filter object, with default behaviors for all methods.
Field Summary | |
static Filter |
ALL
Implements the semantics of "filter all", that is, every call to contains will return false. |
static Filter |
NONE
Implements the semantics of "no filtering", that is, every call to contains will return true. |
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 |
Method Summary | |
void |
accept(FilterVisitor visitor)
Deprecated. use Filter.accept(FilterVisitor, Object) . |
Filter |
and(Filter filter)
Implements a logical AND with this filter and returns the merged filter. |
boolean |
contains(Feature feature)
Deprecated. use evaluate(Feature) |
boolean |
evaluate(Feature feature)
Evaluates the filter against an instance of 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. |
Filter |
not()
Implements a logical NOT with this filter and returns the negated filter |
Filter |
or(Filter filter)
Implements a logical OR with this filter and returns the merged filter. |
Methods inherited from interface org.opengis.filter.Filter |
accept, evaluate |
Field Detail |
public static final Filter NONE
NONE or Filter -> NONE NONE and Filter -> Filter not NONE -> ALL
public static final Filter ALL
ALL or Filter -> Filter ALL and Filter -> ALL not ALL -> NONE
Method Detail |
public boolean evaluate(Feature feature)
Feature
.
feature
- The feature being tested.
public boolean contains(Feature feature)
evaluate(Feature)
This is the core function of any filter. 'Contains' isn't a very good term for this method because it implies some sort of spatial relationship between the feature and the filter that may or may not exist. We name this method 'contains' only because the usage of 'contains' in this context is common and better terms are lacking. However, users of this method should keep in mind the non-spatial nature of this meaning of 'contains.' For example, a feature may be 'contained by' a filter if one of the feature's non-spatial property values is equal to that of the filter's.
Although some filters can be checked for validity when they are
constructed, it is impossible to impose this check on all expressions
because of a special feature of the ExpressionAttribute
class. This class must hold the pointer (in XPath) to an attribute,
but it is not passed the actual attribute (inside a feature) until it
calls the isInside
class.
To avoid a run-time Exception, this class is typed (ie. Double, Integer,
String) when it is created. If the attribute found inside the feature
is found not to conform with its stated type, then a
MalformedExpressionException
is thrown when
contains
is called. Since ExpressionAttribute
classes may be nested inside any filter, all filters must throw this
exception. It is left to callers of this method to deal with it
gracefully.
feature
- Specified feature to examine.
public Filter and(Filter filter)
filter
- The filter to AND with this filter.
public Filter or(Filter filter)
filter
- The filter to OR with this filter.
public Filter not()
public short getFilterType()
public void accept(FilterVisitor visitor)
Filter.accept(FilterVisitor, Object)
.
visitor
- The visitor which requires access to this filter, the
method must call visitor.visit(this);
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |