com.vividsolutions.jump.workbench.model
Class ObservableFeatureCollection

java.lang.Object
  extended by com.vividsolutions.jump.feature.FeatureCollectionWrapper
      extended by com.vividsolutions.jump.workbench.model.ObservableFeatureCollection
All Implemented Interfaces:
FeatureCollection

public class ObservableFeatureCollection
extends FeatureCollectionWrapper

Notifies listeners when features are added to or removed from a FeatureCollection.

Prefer #addAll and #removeAll to #add and #remove, so that fewer events will be fired.


Nested Class Summary
static interface ObservableFeatureCollection.Listener
          Listens for features being added to or removed from a FeatureCollection.
 
Constructor Summary
ObservableFeatureCollection(FeatureCollection fc)
           
 
Method Summary
 void add(Feature feature)
          Adds a feature to this collection.
 void add(ObservableFeatureCollection.Listener listener)
           
 void addAll(java.util.Collection features)
          Adds multiple features to this collection.
 java.util.Collection remove(com.vividsolutions.jts.geom.Envelope env)
          Removes the features which intersect the given envelope
 void remove(Feature feature)
          Removes a feature from this collection.
 void removeAll(java.util.Collection features)
          Removes multiple features from this collection.
 
Methods inherited from class com.vividsolutions.jump.feature.FeatureCollectionWrapper
checkNotWrappingSameClass, clear, getEnvelope, getFeatures, getFeatureSchema, getUltimateWrappee, getWrappee, hasWrapper, isEmpty, iterator, query, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservableFeatureCollection

public ObservableFeatureCollection(FeatureCollection fc)
Method Detail

add

public void add(ObservableFeatureCollection.Listener listener)

add

public void add(Feature feature)
Description copied from interface: FeatureCollection
Adds a feature to this collection.

Specified by:
add in interface FeatureCollection
Overrides:
add in class FeatureCollectionWrapper
Parameters:
feature - a Feature to add to the end of this collection

remove

public void remove(Feature feature)
Description copied from interface: FeatureCollection
Removes a feature from this collection.

Specified by:
remove in interface FeatureCollection
Overrides:
remove in class FeatureCollectionWrapper
Parameters:
feature - a Feature to remove from this collection

addAll

public void addAll(java.util.Collection features)
Description copied from interface: FeatureCollection
Adds multiple features to this collection. To be preferred over #add for adding multiple features, because in some systems (like the JUMP Workbench) fewer events will be fired.

Specified by:
addAll in interface FeatureCollection
Overrides:
addAll in class FeatureCollectionWrapper

removeAll

public void removeAll(java.util.Collection features)
Description copied from interface: FeatureCollection
Removes multiple features from this collection. To be preferred over #remove for removing multiple features, because in some systems (like the JUMP Workbench) fewer events will be fired.

Specified by:
removeAll in interface FeatureCollection
Overrides:
removeAll in class FeatureCollectionWrapper

remove

public java.util.Collection remove(com.vividsolutions.jts.geom.Envelope env)
Description copied from interface: FeatureCollection
Removes the features which intersect the given envelope

Specified by:
remove in interface FeatureCollection
Overrides:
remove in class FeatureCollectionWrapper
Returns:
the removed features