Remove Fids from FidFilter

Description

c.f. previous req on SourceForge and in repsonse to e-mai from Chris Holmes:

would be good to be able to remove one or many Fids (also add many) to FidFilter. Here's a suggested patch (hope this is the appropriate way to submit this):

In "core", org.geotools.filter.FidFilter, add:

/**

  • Adds a collection of feature IDs to the filter.
    *
    * @param fids A collection of feature IDs.
    */
    void addAllFids(Collection fidsToAdd);

/**

  • Removes a collection of feature IDs from the filter.
    *
    * @param fids A collection of feature IDs.
    */
    void removeAllFids(Collection fidsToRemove);

/**

  • Removes a feature ID from the filter.
    *
    * @param fid A single feature ID.
    */
    public final void removeFid(String fid)

and implement them in "defaultcore", org.geotools.filter.FidFilterImpl by adding functions to appropriately manipulate its 'HashSet fids':

/**

  • Removes a collection of feature IDs from the filter.
    *
    * @param fids A collection of feature IDs.
    */
    void removeAllFids(Collection fidsToRemove);
    {
    LOGGER.finest("got" + fidsToRemove.size() + "fids to remove");
    fids.removeAll(fidsToRemove);
    }

/**

  • Adds a collection of feature IDs to the filter.
    *
    * @param fids A collection of feature IDs.
    */
    void addAllFids(Collection fidsToAdd);
    {
    LOGGER.finest("got " + fidsToAdd.size() + " fids to add");
    fids.addAll(fidsToAdd);
    }

/**

  • Removes a feature ID from the filter.
    *
    * @param fid A single feature ID.
    */
    public final void removeFid(String fid)
    {
    LOGGER.finest("got fid to remove: " + fid);
    fids.remove(fid);
    }

Don't know what you want to do with the LOGGER, but o/wise, hope that's as straightforward as it seems!

best,

proshun.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 2:53 PM

CodeHaus Comment From: seangeo - Time: Thu, 19 Feb 2004 19:31:09 -0600
---------------------
Just added this to CVS.

codehaus
April 10, 2015, 2:53 PM

CodeHaus Comment From: proshun - Time: Fri, 20 Feb 2004 09:38:24 -0600
---------------------
thanks v., will try out soon,

proshun.

codehaus
April 10, 2015, 2:53 PM

CodeHaus Comment From: aaime - Time: Sun, 28 Nov 2010 02:56:56 -0600
---------------------
Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Priority

Medium
Configure