org.geotools.data
Class BatchFeatureEvent

Object
  extended by EventObject
      extended by FeatureEvent
          extended by BatchFeatureEvent
All Implemented Interfaces:
Serializable

public class BatchFeatureEvent
extends FeatureEvent

Provide batch notification on Commit / Rollback.

This is used by FeatureListenerManager to report a bit more detail on transaction commit() and rollback(). Previously these changes were represented as an change event with no known bounds.

Author:
Jody Garnett
See Also:
Serialized Form
Module:
modules/library/main (gt-main.jar)

Nested Class Summary
 
Nested classes/interfaces inherited from class FeatureEvent
FeatureEvent.Type
 
Field Summary
protected  WeakHashSet<Identifier> fids
          This is a weak hash set as we don't need to track changes on FeatureIds that are not being used by the client to track selection.
 
Fields inherited from class FeatureEvent
bounds, FEATURES_ADDED, FEATURES_CHANGED, FEATURES_REMOVED, featureSource, filter, type
 
Fields inherited from class EventObject
source
 
Constructor Summary
BatchFeatureEvent(FeatureSource<? extends FeatureType,? extends Feature> featureSource)
           
BatchFeatureEvent(FeatureSource<? extends FeatureType,? extends Feature> featureSource, ReferencedEnvelope bounds, Filter filter)
           
 
Method Summary
 void add(FeatureEvent change)
          Indicate a change being batched.
 WeakHashSet<Identifier> getCreatedFeatureIds()
          This is the set of Identifiers that have been created over the course of this operation.
 void replaceFid(String tempFid, String actualFid)
          Used to update any FeatureId during a commit.
 void setType(FeatureEvent.Type type)
          Used to change this into a COMMIT or ROLLBACK if needed.
 
Methods inherited from class FeatureEvent
getBounds, getEventType, getFeatureSource, getFilter, getType, setFeatureSource
 
Methods inherited from class EventObject
getSource, toString
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fids

protected WeakHashSet<Identifier> fids
This is a weak hash set as we don't need to track changes on FeatureIds that are not being used by the client to track selection.

Constructor Detail

BatchFeatureEvent

public BatchFeatureEvent(FeatureSource<? extends FeatureType,? extends Feature> featureSource)

BatchFeatureEvent

public BatchFeatureEvent(FeatureSource<? extends FeatureType,? extends Feature> featureSource,
                         ReferencedEnvelope bounds,
                         Filter filter)
Method Detail

setType

public void setType(FeatureEvent.Type type)
Used to change this into a COMMIT or ROLLBACK if needed.

Parameters:
type -

add

public void add(FeatureEvent change)
Indicate a change being batched.

Will be use to update internal state of bounds and filter; in the special case of Features being added we will record the FeatureIds in case we need to update them later (this is only required for a *commit* event).


replaceFid

public void replaceFid(String tempFid,
                       String actualFid)
Used to update any FeatureId during a commit.


getCreatedFeatureIds

public WeakHashSet<Identifier> getCreatedFeatureIds()
This is the set of Identifiers that have been created over the course of this operation.

Please note that this is only the set of identifiers that is *still in use*; if no client code is holding on to these Identifiers waiting to see what the final value will be we are not going to hold onto these for you.

Returns:
Set of Identifiers created during this commit


Copyright © 1996-2010 Geotools. All Rights Reserved.