Determines whether or not a given feature is 'contained by' this filter.
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.
Parameters: feature - Specified feature to examine. True if filter contains passed feature.Filter.evaluate(Feature) |