org.geotools.wfs
Class CompositeFeatureCollection

Object
  extended by DataFeatureCollection
      extended by CompositeFeatureCollection
All Implemented Interfaces:
FeatureCollection<SimpleFeatureType,SimpleFeature>

public class CompositeFeatureCollection
extends DataFeatureCollection

Wraps multiple feature collections into a single.

This feature collection is used for wfs feature collections which can be made up of features from different schemas.

Author:
Justin Deoliveira, The Open Planning Project
Module:
modules/extension/xsd-wfs (gt-xsd-wfs.jar)

Field Summary
 
Fields inherited from class DataFeatureCollection
id, listeners, schema
 
Constructor Summary
CompositeFeatureCollection(List collections)
           
 
Method Summary
 boolean addAll(Collection arg0)
          Optimized implementation of addAll that recognizes the use of collections obtained with subCollection( filter ).
 ReferencedEnvelope getBounds()
          Get the total bounds of this collection which is calculated by doing a union of the bounds of each feature inside of it
 int getCount()
           
 FeatureId getIdentifier()
           
 SimpleFeatureType getSchema()
          The schema for the child features of this collection.
protected  Iterator openIterator()
          Returns a FeatureWriterIterator, or FeatureReaderIterator over content.
 boolean removeAll(Collection arg0)
           
 boolean retainAll(Collection arg0)
           
 Object[] toArray(Object[] arg0)
           
 
Methods inherited from class DataFeatureCollection
accepts, accepts, add, addAll, addListener, clear, close, close, closeIterator, contains, containsAll, features, fireChange, fireChange, fireChange, getID, isEmpty, iterator, purge, reader, remove, removeListener, size, sort, sort, subCollection, toArray, writer
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeFeatureCollection

public CompositeFeatureCollection(List collections)
Method Detail

openIterator

protected Iterator openIterator()
                         throws IOException
Description copied from class: DataFeatureCollection
Returns a FeatureWriterIterator, or FeatureReaderIterator over content.

If you have a way to tell that you are readonly please subclass with a less hardcore check - this implementations catches a UnsupportedOpperationsException from wrtier()!

Overrides:
openIterator in class DataFeatureCollection
Returns:
Iterator, should be closed closeIterator
Throws:
IOException

getSchema

public SimpleFeatureType getSchema()
Description copied from interface: FeatureCollection
The schema for the child features of this collection.

There is a difference between getFeatureType() and getSchema()represents the LCD FeatureType that best represents the contents of this collection.

The method getSchema() is named for compatability with the geotools 2.0 API. In the Geotools 2.2 time frame we should be able to replace this method with a careful check of getFeatureType() and its attributes.

Specified by:
getSchema in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
Overrides:
getSchema in class DataFeatureCollection
Returns:
FeatureType describing the "common" schema to all child features of this collection

getBounds

public ReferencedEnvelope getBounds()
Description copied from interface: FeatureCollection
Get the total bounds of this collection which is calculated by doing a union of the bounds of each feature inside of it

Specified by:
getBounds in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
Specified by:
getBounds in class DataFeatureCollection
Returns:
An Envelope containing the total bounds of this collection.

getCount

public int getCount()
             throws IOException
Specified by:
getCount in class DataFeatureCollection
Throws:
IOException

addAll

public boolean addAll(Collection arg0)
Description copied from class: DataFeatureCollection
Optimized implementation of addAll that recognizes the use of collections obtained with subCollection( filter ).

This method is constructed by either:

Specified by:
addAll in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
Overrides:
addAll in class DataFeatureCollection
See Also:
Collection.addAll(Collection)

removeAll

public boolean removeAll(Collection arg0)
Specified by:
removeAll in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
Overrides:
removeAll in class DataFeatureCollection
See Also:
Collection.removeAll(Collection)

retainAll

public boolean retainAll(Collection arg0)
Specified by:
retainAll in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
Overrides:
retainAll in class DataFeatureCollection
See Also:
Collection.retainAll(Collection)

toArray

public Object[] toArray(Object[] arg0)
Specified by:
toArray in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
Overrides:
toArray in class DataFeatureCollection
See Also:
Collection.toArray(Object[])

getIdentifier

public FeatureId getIdentifier()


Copyright © 1996-2010 Geotools. All Rights Reserved.