org.geotools.filter
Class FidFilterImpl

java.lang.Object
  extended byorg.geotools.filter.AbstractFilter
      extended byorg.geotools.filter.AbstractFilterImpl
          extended byorg.geotools.filter.FidFilterImpl
All Implemented Interfaces:
FidFilter, 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,v 1.13 2004/02/20 00:18:31 seangeo Exp $
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
 void accept(FilterVisitor visitor)
          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 contains(Feature feature)
          Determines whether or not the given feature's ID matches this filter.
 boolean equals(java.lang.Object filter)
          Returns a flag indicating object equality.
 java.lang.String[] getFids()
          Returns all the fids in this filter.
 java.util.Set getFidsSet()
          Accessor method for fid set.
 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.
 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
getFilterType, isCompareFilter, isGeometryDistanceFilter, isGeometryFilter, isLogicFilter, isMathFilter, isSimpleFilter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.filter.Filter
and, getFilterType, not, or
 

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.

contains

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

Specified by:
contains in interface FidFilter
Specified by:
contains in class AbstractFilter
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 java.lang.String[] getFids()
Returns all the fids in this filter.

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

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

addAllFids

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

Specified by:
addAllFids in interface FidFilter

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 void accept(FilterVisitor visitor)
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
Specified by:
accept in class AbstractFilter
Parameters:
visitor - The visitor which requires access to this filter, the method must call visitor.visit(this);


Copyright © GeoTools. All Rights Reserved.