org.geotools.filter
Class FidFilterImpl

java.lang.Object
  extended byorg.geotools.filter.FilterAbstract
      extended byorg.geotools.filter.AbstractFilter
          extended byorg.geotools.filter.AbstractFilterImpl
              extended byorg.geotools.filter.FidFilterImpl
All Implemented Interfaces:
org.opengis.filter.FeatureId, FidFilter, Filter, org.opengis.filter.Filter, FilterType

public class FidFilterImpl
extends AbstractFilterImpl
implements FidFilter

Defines a feature ID filter, which holds a list of feature IDs. This filter stores a series of feature IDs, which are used to distinguish features uniquely.

Version:
$Id: FidFilterImpl.java 18021 2006-02-14 20:36:18Z jdeolive $
Author:
Rob Hranac, TOPP

Field Summary
 
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 FidFilterImpl()
          Empty constructor.
protected FidFilterImpl(java.lang.String initialFid)
          Constructor with first fid set
 
Method Summary
 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 addAllFids(java.util.Collection fidsToAdd)
          Adds a collection of feature IDs to the filter.
 void addFid(java.lang.String fid)
          Adds a feature ID to the filter.
 boolean equals(java.lang.Object filter)
          Returns a flag indicating object equality.
 boolean evaluate(Feature feature)
          Determines whether or not the given feature's ID matches this filter.
 java.lang.String[] getFids()
          Deprecated. use getIDs()
 java.util.Set getFidsSet()
          Accessor method for fid set.
 java.util.Set getIDs()
           
 int hashCode()
          Override of hashCode method.
 void removeAllFids(java.util.Collection fidsToRemove)
          Removes a collection of feature IDs from the filter.
 void removeFid(java.lang.String fid)
          Removes a feature ID from the filter.
 void setIDs(java.util.Set ids)
           
 java.lang.String toString()
          Returns a string representation of this filter.
 
Methods inherited from class org.geotools.filter.AbstractFilterImpl
and, 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.FidFilter
contains
 
Methods inherited from interface org.geotools.filter.Filter
accept, and, getFilterType, not, or
 
Methods inherited from interface org.opengis.filter.Filter
evaluate
 

Constructor Detail

FidFilterImpl

protected FidFilterImpl()
Empty constructor.


FidFilterImpl

protected FidFilterImpl(java.lang.String initialFid)
Constructor with first fid set

Parameters:
initialFid - The type of comparison.
Method Detail

addFid

public final void addFid(java.lang.String fid)
Adds a feature ID to the filter.

Specified by:
addFid in interface FidFilter
Parameters:
fid - A single feature ID.

evaluate

public boolean evaluate(Feature feature)
Determines whether or not the given feature's ID matches this filter.

Specified by:
evaluate in interface Filter
Overrides:
evaluate in class FilterAbstract
Parameters:
feature - Specified feature to examine.
Returns:
true if the feature's ID matches an fid held by this filter, false otherwise.

toString

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

Returns:
String representation of the compare filter.

equals

public boolean equals(java.lang.Object filter)
Returns a flag indicating object equality.

Parameters:
filter - the filter to test equality on.
Returns:
String representation of the compare filter.

hashCode

public int hashCode()
Override of hashCode method.

Returns:
a hash code value for this fid filter object.

getFids

public final java.lang.String[] getFids()
Deprecated. use getIDs()

Returns all the fids in this filter.

Specified by:
getFids in interface FidFilter
Returns:
An array of all the fids in this filter.

getIDs

public java.util.Set getIDs()
Specified by:
getIDs in interface org.opengis.filter.FeatureId
See Also:
FeatureId.getIDs()

setIDs

public void setIDs(java.util.Set ids)
Specified by:
setIDs in interface org.opengis.filter.FeatureId
See Also:
FeatureId.setIDs(Set)

getFidsSet

public java.util.Set getFidsSet()
Accessor method for fid set.

Returns:
the internally stored fids.

removeAllFids

public void removeAllFids(java.util.Collection fidsToRemove)
Removes a collection of feature IDs from the filter.

Specified by:
removeAllFids in interface FidFilter
Parameters:
fidsToRemove - A collection of feature IDs.

addAllFids

public void addAllFids(java.util.Collection fidsToAdd)
Adds a collection of feature IDs to the filter.

Specified by:
addAllFids in interface FidFilter
Parameters:
fidsToAdd - A collection of feature IDs.

removeFid

public final void removeFid(java.lang.String fid)
Removes a feature ID from the filter.

Specified by:
removeFid in interface FidFilter
Parameters:
fid - A single feature ID.

accept

public java.lang.Object accept(org.opengis.filter.FilterVisitor visitor,
                               java.lang.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 org.opengis.filter.Filter
Overrides:
accept in class FilterAbstract
Parameters:
visitor - The visitor which requires access to this filter, the method must call visitor.visit(this);


Copyright © GeoTools. All Rights Reserved.