|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectFilterAbstract
AbstractFilter
BinaryComparisonAbstract
GeometryFilterImpl
public abstract class GeometryFilterImpl
Implements a geometry filter.
This filter implements a relationship - of some sort - between two geometry expressions. Note that this comparison does not attempt to restict its expressions to be meaningful. This means that it considers itself a valid filter as long as it contains two geometry sub-expressions. It is also slightly less restrictive than the OGC Filter specification because it does not require that one sub-expression be an geometry attribute and the other be a geometry literal.
In other words, you may use this filter to compare two geometries in the same feature, such as: attributeA inside attributeB? You may also compare two literal geometries, although this is fairly meaningless, since it could be reduced (ie. it is always either true or false). This approach is very similar to that taken in the FilterCompare class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface MultiValuedFilter |
---|
MultiValuedFilter.MatchAction |
Field Summary | |
---|---|
protected MultiValuedFilter.MatchAction |
matchAction
|
Fields inherited from class BinaryComparisonAbstract |
---|
expression1, expression2 |
Fields inherited from class AbstractFilter |
---|
filterType, permissiveConstruction |
Fields inherited from class FilterAbstract |
---|
factory |
Fields inherited from interface Filter |
---|
ALL, NONE |
Fields inherited from interface Filter |
---|
EXCLUDE, INCLUDE |
Constructor Summary | |
---|---|
protected |
GeometryFilterImpl(FilterFactory factory)
|
protected |
GeometryFilterImpl(FilterFactory factory,
Expression e1,
Expression e2)
|
protected |
GeometryFilterImpl(FilterFactory factory,
Expression e1,
Expression e2,
MultiValuedFilter.MatchAction matchAction)
|
protected |
GeometryFilterImpl(FilterFactory factory,
MultiValuedFilter.MatchAction matchAction)
|
protected |
GeometryFilterImpl(short filterType)
Constructor with filter type. |
Method Summary | |
---|---|
void |
addLeftGeometry(Expression leftGeometry)
Deprecated. use setExpression1(org.opengis.filter.expression.Expression) |
void |
addRightGeometry(Expression rightGeometry)
Deprecated. use #set |
boolean |
equals(Object obj)
Compares this filter to the specified object. |
boolean |
evaluate(Object feature)
Give an object, this method determines if the test(s) represented by this filter object are passed. |
boolean |
evaluate(SimpleFeature feature)
Determines whether or not a given feature is 'inside' this filter. |
protected abstract boolean |
evaluateInternal(Geometry left,
Geometry right)
Performs the calculation on the two geometries. |
protected static Object |
getGeometries(Expression expr,
Object feature)
NC - support for multiple values Convenience method for returning expression as either a geometry or a list of geometries. |
Expression |
getLeftGeometry()
Deprecated. use BinarySpatialOperator.getExpression1() |
protected Geometry |
getLeftGeometry(Object feature)
Subclass convenience method for returning left expression as a JTS geometry |
MultiValuedFilter.MatchAction |
getMatchAction()
Flag Controlling MatchAction property When one or more of the operands evaluates to multiple values rather than a single value, which action should be taken? |
Expression |
getRightGeometry()
Deprecated. use BinarySpatialOperator.getExpression2() |
protected Geometry |
getRightGeometry(Object feature)
Deprecated. use org.geotools.filter |
int |
hashCode()
Override of hashCode method. |
void |
setExpression1(Expression expression)
|
void |
setExpression2(Expression expression)
|
String |
toString()
Return this filter as a string. |
Methods inherited from class BinaryComparisonAbstract |
---|
and, comparable, eval, eval, getExpression1, getExpression2, isMatchingCase, not, or |
Methods inherited from class AbstractFilter |
---|
accept, contains, getFilterType, isCompareFilter, isGeometryDistanceFilter, isGeometryFilter, isLogicFilter, isMathFilter, isSimpleFilter |
Methods inherited from class FilterAbstract |
---|
accept, accepts, eval, eval, eval |
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface GeometryFilter |
---|
contains |
Methods inherited from interface Filter |
---|
accept, and, getFilterType, not, or |
Methods inherited from interface BinarySpatialOperator |
---|
getExpression1, getExpression2 |
Methods inherited from interface Filter |
---|
accept |
Field Detail |
---|
protected MultiValuedFilter.MatchAction matchAction
Constructor Detail |
---|
protected GeometryFilterImpl(FilterFactory factory, MultiValuedFilter.MatchAction matchAction)
protected GeometryFilterImpl(FilterFactory factory, Expression e1, Expression e2, MultiValuedFilter.MatchAction matchAction)
protected GeometryFilterImpl(FilterFactory factory)
protected GeometryFilterImpl(FilterFactory factory, Expression e1, Expression e2)
protected GeometryFilterImpl(short filterType) throws IllegalFilterException
filterType
- The type of comparison.
IllegalFilterException
- Non-geometry type.Method Detail |
---|
public final void addLeftGeometry(Expression leftGeometry) throws IllegalFilterException
setExpression1(org.opengis.filter.expression.Expression)
addLeftGeometry
in interface GeometryFilter
leftGeometry
- Expression for 'left' value.
IllegalFilterException
- Filter is not internally consistent.public void setExpression1(Expression expression)
setExpression1
in class BinaryComparisonAbstract
public final void addRightGeometry(Expression rightGeometry) throws IllegalFilterException
#set
addRightGeometry
in interface GeometryFilter
rightGeometry
- Expression for 'right' value.
IllegalFilterException
- Filter is not internally consistent.public void setExpression2(Expression expression)
setExpression2
in class BinaryComparisonAbstract
public final Expression getLeftGeometry()
BinarySpatialOperator.getExpression1()
getLeftGeometry
in interface GeometryFilter
public final Expression getRightGeometry()
BinarySpatialOperator.getExpression2()
getRightGeometry
in interface GeometryFilter
protected Geometry getLeftGeometry(Object feature)
org.geotools.filter
protected Geometry getRightGeometry(Object feature)
org.geotools.filter
protected static Object getGeometries(Expression expr, Object feature)
public boolean evaluate(SimpleFeature feature)
evaluate
in class FilterAbstract
feature
- Specified feature to examine.
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- - the object to compare this GeometryFilter against.
public int hashCode()
hashCode
in class Object
public MultiValuedFilter.MatchAction getMatchAction()
MultiValuedFilter
getMatchAction
in interface MultiValuedFilter
getMatchAction
in class BinaryComparisonAbstract
public final boolean evaluate(Object feature)
Filter
This ability is used to allow Queries against both Features and and non spatial data (such as Record) and to express constraints on permissable data values.
evaluate
in interface Filter
true if the test(s) are passed for the provided object
protected abstract boolean evaluateInternal(Geometry left, Geometry right)
left
- the geometry on the left of the equations (the geometry obtained from evaluating Expression1)right
- the geometry on the right of the equations (the geometry obtained from evaluating Expression2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |