Package org.geotools.feature.collection
Class SubFeatureCollection
- Object
- 
- BaseFeatureCollection<SimpleFeatureType,SimpleFeature>
- 
- BaseSimpleFeatureCollection
- 
- SubFeatureCollection
 
 
 
- 
- All Implemented Interfaces:
- SimpleFeatureCollection,- FeatureCollection<SimpleFeatureType,SimpleFeature>
 - Direct Known Subclasses:
- SubFeatureList
 
 public class SubFeatureCollection extends BaseSimpleFeatureCollection Reasonable default implementation for subCollection making use of parentSimpleFeatureCollection.features()and provided Filter.This is only a reasonable implementation and is not optimal. It is recommended that implementors construct a new Queryand useSimpleFeatureSource.getFeatures(Query).- Author:
- Jody Garnett, Refractions Research, Inc.
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected SimpleFeatureCollectioncollectionOriginal Collectionprotected FilterFactoryffprotected FilterfilterFilter- 
Fields inherited from class BaseFeatureCollectionid, schema
 
- 
 - 
Constructor SummaryConstructors Constructor Description SubFeatureCollection(SimpleFeatureCollection collection)SubFeatureCollection(SimpleFeatureCollection collection, Filter subfilter)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FiltercreateFilter()Override to implement subsettingSimpleFeatureIteratorfeatures()Subclasses required to implement this method to traverse FeatureCollection contents.protected Filterfilter()Generate filter to use for content, makes use ofcreateFilter()if needed.ReferencedEnvelopegetBounds()Calculates the bounds of the features without caching.StringgetID()ID used when serializing to GMLintsize()Returns the number of elements in this collection.SimpleFeatureCollectionsort(SortBy order)Obtained sorted contents, only implemented for SimpleFeature at present.SimpleFeatureCollectionsubCollection(Filter filter)Convenience implementation that just wraps this collection into aFilteringFeatureCollection.- 
Methods inherited from class BaseFeatureCollectionaccepts, contains, containsAll, getSchema, isEmpty, toArray, toArray
 - 
Methods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface FeatureCollectionaccepts, contains, containsAll, getSchema, isEmpty, toArray, toArray
 
- 
 
- 
- 
- 
Field Detail- 
filterprotected Filter filter Filter
 - 
collectionprotected SimpleFeatureCollection collection Original Collection
 - 
ffprotected FilterFactory ff 
 
- 
 - 
Constructor Detail- 
SubFeatureCollectionpublic SubFeatureCollection(SimpleFeatureCollection collection) 
 - 
SubFeatureCollectionpublic SubFeatureCollection(SimpleFeatureCollection collection, Filter subfilter) - Parameters:
- collection- Collection or AbstractFeatureCollection
 
 
- 
 - 
Method Detail- 
featurespublic SimpleFeatureIterator 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 interface- FeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
- featuresin interface- SimpleFeatureCollection
- Specified by:
- featuresin class- BaseSimpleFeatureCollection
- Returns:
- A FeatureIterator.
 
 - 
sizepublic int size() Description copied from class:BaseFeatureCollectionReturns the number of elements in this collection.- Specified by:
- sizein interface- FeatureCollection<SimpleFeatureType,SimpleFeature>
- Overrides:
- sizein class- BaseFeatureCollection<SimpleFeatureType,SimpleFeature>
- Returns:
- Number of items, or Interger.MAX_VALUE
- See Also:
- Collection.size()
 
 - 
filterprotected Filter filter() Generate filter to use for content, makes use ofcreateFilter()if needed.- Returns:
- Filter to use for content
 
 - 
createFilterprotected Filter createFilter() Override to implement subsetting
 - 
subCollectionpublic SimpleFeatureCollection subCollection(Filter filter) 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 interface- FeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
- subCollectionin interface- SimpleFeatureCollection
- Overrides:
- subCollectionin class- BaseSimpleFeatureCollection
- Returns:
- SimpleFeatureCollection identified as subset.
- See Also:
- FeatureList
 
 - 
sortpublic SimpleFeatureCollection sort(SortBy order) 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 interface- FeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
- sortin interface- SimpleFeatureCollection
- Overrides:
- sortin class- BaseSimpleFeatureCollection
- Parameters:
- order- Sort order
- Returns:
- FeatureCollection sorted in the indicated order
 
 - 
getIDpublic String getID() Description copied from interface:FeatureCollectionID used when serializing to GML- Specified by:
- getIDin interface- FeatureCollection<SimpleFeatureType,SimpleFeature>
- Overrides:
- getIDin class- BaseFeatureCollection<SimpleFeatureType,SimpleFeature>
 
 - 
getBoundspublic ReferencedEnvelope getBounds() Calculates the bounds of the features without caching.- Specified by:
- getBoundsin interface- FeatureCollection<SimpleFeatureType,SimpleFeature>
- Overrides:
- getBoundsin class- BaseFeatureCollection<SimpleFeatureType,SimpleFeature>
- Returns:
- An Envelope containing the total bounds of this collection.
 
 
- 
 
-