Package org.geotools.feature.collection
Class SubFeatureCollection
Object
BaseFeatureCollection<SimpleFeatureType,SimpleFeature>
 
BaseSimpleFeatureCollection
SubFeatureCollection
- All Implemented Interfaces:
 SimpleFeatureCollection,FeatureCollection<SimpleFeatureType,SimpleFeature> 
- Direct Known Subclasses:
 SubFeatureList
Reasonable default implementation for subCollection making use of parent 
SimpleFeatureCollection.features()
 and provided Filter.
 This is only a reasonable implementation and is not optimal. It is recommended that implementors construct a new
 Query and use SimpleFeatureSource.getFeatures(Query).
- Author:
 - Jody Garnett, Refractions Research, Inc.
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SimpleFeatureCollectionOriginal Collectionprotected FilterFactoryprotected FilterFilterFields inherited from class BaseFeatureCollection
id, schema - 
Constructor Summary
ConstructorsConstructorDescriptionSubFeatureCollection(SimpleFeatureCollection collection) SubFeatureCollection(SimpleFeatureCollection collection, Filter subfilter)  - 
Method Summary
Modifier and TypeMethodDescriptionprotected FilterOverride to implement subsettingfeatures()Subclasses required to implement this method to traverse FeatureCollection contents.protected Filterfilter()Generate filter to use for content, makes use ofcreateFilter()if needed.Calculates the bounds of the features without caching.getID()ID used when serializing to GMLintsize()Returns the number of elements in this collection.Obtained sorted contents, only implemented for SimpleFeature at present.subCollection(Filter filter) Convenience implementation that just wraps this collection into aFilteringFeatureCollection.Methods inherited from class BaseFeatureCollection
accepts, contains, containsAll, getSchema, isEmpty, toArray, toArrayMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FeatureCollection
accepts, contains, containsAll, getSchema, isEmpty, toArray, toArray 
- 
Field Details
- 
filter
Filter - 
collection
Original Collection - 
ff
 
 - 
 - 
Constructor Details
- 
SubFeatureCollection
 - 
SubFeatureCollection
- Parameters:
 collection- Collection or AbstractFeatureCollection
 
 - 
 - 
Method Details
- 
features
Description copied from class:BaseSimpleFeatureCollectionSubclasses required to implement this method to traverse FeatureCollection contents.Note that
FeatureIterator.close()is available to clean up after any resource use required during traversal.- Specified by:
 featuresin interfaceFeatureCollection<SimpleFeatureType,SimpleFeature> - Specified by:
 featuresin interfaceSimpleFeatureCollection- Specified by:
 featuresin classBaseSimpleFeatureCollection- Returns:
 - A FeatureIterator.
 
 - 
size
public int size()Description copied from class:BaseFeatureCollectionReturns the number of elements in this collection.- Specified by:
 sizein interfaceFeatureCollection<SimpleFeatureType,SimpleFeature> - Overrides:
 sizein classBaseFeatureCollection<SimpleFeatureType,SimpleFeature> - Returns:
 - Number of items, or Interger.MAX_VALUE
 - See Also:
 
 - 
filter
Generate filter to use for content, makes use ofcreateFilter()if needed.- Returns:
 - Filter to use for content
 
 - 
createFilter
Override to implement subsetting - 
subCollection
Description copied from class:BaseFeatureCollectionConvenience implementation that just wraps this collection into aFilteringFeatureCollection. Subclasses might want to override this in case the filter can be cascaded to their data sources.- Specified by:
 subCollectionin interfaceFeatureCollection<SimpleFeatureType,SimpleFeature> - Specified by:
 subCollectionin interfaceSimpleFeatureCollection- Overrides:
 subCollectionin classBaseSimpleFeatureCollection- Returns:
 - SimpleFeatureCollection identified as subset.
 - See Also:
 - 
FeatureList
 
 - 
sort
Description copied from class:BaseFeatureCollectionObtained sorted contents, only implemented for SimpleFeature at present.This method only supports SimpleFeature at present, consider use of FeatureSource.features( Query ).
- Specified by:
 sortin interfaceFeatureCollection<SimpleFeatureType,SimpleFeature> - Specified by:
 sortin interfaceSimpleFeatureCollection- Overrides:
 sortin classBaseSimpleFeatureCollection- Parameters:
 order- Sort order- Returns:
 - FeatureCollection sorted in the indicated order
 
 - 
getID
Description copied from interface:FeatureCollectionID used when serializing to GML- Specified by:
 getIDin interfaceFeatureCollection<SimpleFeatureType,SimpleFeature> - Overrides:
 getIDin classBaseFeatureCollection<SimpleFeatureType,SimpleFeature> 
 - 
getBounds
Calculates the bounds of the features without caching.- Specified by:
 getBoundsin interfaceFeatureCollection<SimpleFeatureType,SimpleFeature> - Overrides:
 getBoundsin classBaseFeatureCollection<SimpleFeatureType,SimpleFeature> - Returns:
 - An Envelope containing the total bounds of this collection.
 
 
 -