|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.filter.FilterAbstract org.geotools.filter.AbstractFilter org.geotools.filter.BinaryComparisonAbstract org.geotools.filter.CompareFilterImpl
Defines a comparison filter (can be a math comparison or generic equals). This filter implements a comparison - of some sort - between two expressions. The comparison may be a math comparison or a generic equals comparison. If it is a math comparison, only math expressions are allowed; if it is an equals comparison, any expression types are allowed. Note that this comparison does not attempt to restrict its expressions to be meaningful. This means that it considers itself a valid filter as long as the expression comparison returns a valid result. It does no checking to see whether or not the expression comparison is meaningful with regard to checking feature attributes. In other words, this is a valid filter: 52 = 92, even though it will always return the same result and could be simplified away. It is up the the filter creator, therefore, to attempt to simplify/make meaningful filter logic.
Field Summary |
Fields inherited from class org.geotools.filter.BinaryComparisonAbstract |
expression1, expression2 |
Fields inherited from class org.geotools.filter.AbstractFilter |
filterType, permissiveConstruction |
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 |
CompareFilterImpl(FilterFactory factory,
org.opengis.filter.expression.Expression e1,
org.opengis.filter.expression.Expression e2)
|
protected |
CompareFilterImpl(short filterType)
Constructor with filter type. |
Method Summary | |
abstract java.lang.Object |
accept(org.opengis.filter.FilterVisitor visitor,
java.lang.Object extraData)
Used by FilterVisitors to perform some action on this filter instance. |
void |
addLeftValue(Expression leftValue)
Adds the 'left' value to this filter. |
void |
addRightValue(Expression rightValue)
Adds the 'right' value to this filter. |
protected int |
compare(java.lang.Comparable leftObj,
java.lang.Comparable rightObj)
Subclass convenience method which compares to instances of comparables in a pretty lax way, converting types among String, Number, Double when appropriate. |
boolean |
equals(java.lang.Object obj)
Compares this filter to the specified object. |
abstract boolean |
evaluate(Feature feature)
Determines whether or not a given feature is 'inside' this filter. |
Expression |
getLeftValue()
Gets the left expression. |
Expression |
getRightValue()
Deprecated. use BinaryComparisonAbstract.getExpression2() |
int |
hashCode()
Override of hashCode method. |
void |
setExpression1(org.opengis.filter.expression.Expression leftValue)
|
void |
setExpression2(org.opengis.filter.expression.Expression rightValue)
|
java.lang.String |
toString()
Returns a string representation of this filter. |
Methods inherited from class org.geotools.filter.BinaryComparisonAbstract |
and, getExpression1, getExpression2, not, or |
Methods inherited from class org.geotools.filter.AbstractFilter |
accept, contains, evaluate, getFilterType, isCompareFilter, isGeometryDistanceFilter, isGeometryFilter, isLogicFilter, isMathFilter, isSimpleFilter |
Methods inherited from class org.geotools.filter.FilterAbstract |
accepts, comparable, eval, eval |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.geotools.filter.CompareFilter |
contains |
Methods inherited from interface org.geotools.filter.Filter |
accept, and, getFilterType, not, or |
Methods inherited from interface org.opengis.filter.Filter |
evaluate |
Methods inherited from interface org.opengis.filter.BinaryComparisonOperator |
getExpression1, getExpression2 |
Constructor Detail |
protected CompareFilterImpl(short filterType) throws IllegalFilterException
filterType
- The type of comparison.
IllegalFilterException
- Non-compare type.protected CompareFilterImpl(FilterFactory factory, org.opengis.filter.expression.Expression e1, org.opengis.filter.expression.Expression e2)
Method Detail |
public final void addLeftValue(Expression leftValue) throws IllegalFilterException
addLeftValue
in interface CompareFilter
leftValue
- Expression for 'left' value.
IllegalFilterException
- Filter is not internally consistent.public void setExpression1(org.opengis.filter.expression.Expression leftValue)
setExpression1
in interface org.opengis.filter.BinaryComparisonOperator
setExpression1
in class BinaryComparisonAbstract
public final void addRightValue(Expression rightValue) throws IllegalFilterException
addRightValue
in interface CompareFilter
rightValue
- Expression for 'right' value.
IllegalFilterException
- Filter is not internally consistent.public void setExpression2(org.opengis.filter.expression.Expression rightValue)
setExpression2
in interface org.opengis.filter.BinaryComparisonOperator
setExpression2
in class BinaryComparisonAbstract
public final Expression getLeftValue()
getLeftValue
in interface CompareFilter
BinaryComparisonAbstract.getExpression1()
public final Expression getRightValue()
BinaryComparisonAbstract.getExpression2()
getRightValue
in interface CompareFilter
public abstract boolean evaluate(Feature feature)
evaluate
in interface Filter
evaluate
in class FilterAbstract
feature
- Specified feature to examine.
protected int compare(java.lang.Comparable leftObj, java.lang.Comparable rightObj)
Comparable.compareTo(java.lang.Object)
.public java.lang.String toString()
public boolean equals(java.lang.Object obj)
obj
- - the object to compare this CompareFilter against.
public int hashCode()
public abstract java.lang.Object accept(org.opengis.filter.FilterVisitor visitor, java.lang.Object extraData)
accept
in interface org.opengis.filter.Filter
accept
in class FilterAbstract
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 |