org.geotools.filter
Class NullFilterImpl

Object
  extended by FilterAbstract
      extended by AbstractFilter
          extended by AbstractFilterImpl
              extended by NullFilterImpl
All Implemented Interfaces:
FilterType, NullFilter, Filter, PropertyIsNull

public class NullFilterImpl
extends AbstractFilterImpl
implements NullFilter

Defines a null filter, which checks to see if an attribute is null.

Author:
Rob Hranac, Vision for New York
Module:

Field Summary
 
Fields inherited from class AbstractFilter
filterType, LOGGER, permissiveConstruction
 
Fields inherited from class FilterAbstract
factory
 
Fields inherited from interface Filter
ALL, NONE
 
Fields inherited from interface 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
 
Fields inherited from interface Filter
EXCLUDE, INCLUDE
 
Fields inherited from interface PropertyIsNull
NAME
 
Fields inherited from interface Filter
EXCLUDE, INCLUDE
 
Constructor Summary
protected NullFilterImpl()
          Constructor which sets the type as null check.
 
Method Summary
 Object accept(FilterVisitor visitor, Object extraData)
          Used by FilterVisitors to perform some action on this filter instance.
 boolean equals(Object obj)
          Compares this filter to the specified object.
 boolean evaluate(Object feature)
          Determines whether or not a given feature is 'inside' this filter.
 Expression getExpression()
          Returns the expression which represents the null check.
 Expression getNullCheckValue()
          Deprecated. use getExpression().
 int hashCode()
          Override of hashCode method.
 void nullCheckValue(Expression nullCheck)
          Deprecated. use PropertyIsNull#setExpression(Expression)
 void setExpression(Expression nullCheck)
          Sets the expression which represents the null check.
 String toString()
          Returns a string representation of this filter.
 
Methods inherited from class AbstractFilterImpl
and, not, or
 
Methods inherited from class AbstractFilter
accept, contains, getFilterType, isCompareFilter, isGeometryDistanceFilter, isGeometryFilter, isLogicFilter, isMathFilter, isSimpleFilter
 
Methods inherited from class FilterAbstract
accepts, eval, eval, eval, evaluate
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface NullFilter
contains
 
Methods inherited from interface Filter
accept, and, evaluate, getFilterType, not, or
 

Constructor Detail

NullFilterImpl

protected NullFilterImpl()
Constructor which sets the type as null check.

Method Detail

nullCheckValue

public final void nullCheckValue(Expression nullCheck)
                          throws IllegalFilterException
Deprecated. use PropertyIsNull#setExpression(Expression)

Determines whether or not a given feature is 'inside' this filter.

Specified by:
nullCheckValue in interface NullFilter
Parameters:
nullCheck - The attribute expression to null check.
Throws:
IllegalFilterException - If attempting to add a non-attribute expression.
TODO:
REVISIT: change arg to AttributeExpression?, REVISIT: change name to setNullCheckValue.

getNullCheckValue

public final Expression getNullCheckValue()
Deprecated. use getExpression().

Returns the expression being checked for null.

Specified by:
getNullCheckValue in interface NullFilter
Returns:
the Expression to null check.

getExpression

public Expression getExpression()
Returns the expression which represents the null check.

Specified by:
getExpression in interface PropertyIsNull

setExpression

public void setExpression(Expression nullCheck)
Sets the expression which represents the null check.


evaluate

public boolean evaluate(Object feature)
Determines whether or not a given feature is 'inside' this filter.

Specified by:
evaluate in interface Filter
Parameters:
feature - Specified feature to examine.
Returns:
Flag confirming whether or not this feature is inside the filter.

toString

public String toString()
Returns a string representation of this filter.

Overrides:
toString in class Object
Returns:
String representation of the null filter.

equals

public boolean equals(Object obj)
Compares this filter to the specified object. Returns true if the passed in object is the same as this filter. Checks to make sure the filter types, and the NullCheckValue are the same.

Overrides:
equals in class Object
Parameters:
obj - - the object to compare this LikeFilter against.
Returns:
true if specified object is equal to this filter; false otherwise.

hashCode

public int hashCode()
Override of hashCode method.

Overrides:
hashCode in class Object
Returns:
a hash code value for this geometry filter.

accept

public Object accept(FilterVisitor visitor,
                     Object extraData)
Used by FilterVisitors to perform some action on this filter instance. Typicaly used by Filter decoders, but may also be used by any thing which needs infomration from filter structure. Implementations should always call: visitor.visit(this); It is importatant that this is not left to a parent class unless the parents API is identical.

Specified by:
accept in interface Filter
Overrides:
accept in class FilterAbstract
Parameters:
visitor - The visitor which requires access to this filter, the method must call visitor.visit(this);


Copyright © 1996-2009 Geotools. All Rights Reserved.