org.geotools.data.collection
Class CollectionFeatureSource.SubCollection

Object
  extended by DecoratingSimpleFeatureCollection
      extended by CollectionFeatureSource.SubCollection
All Implemented Interfaces:
SimpleFeatureCollection, FeatureCollection<SimpleFeatureType,SimpleFeature>
Enclosing class:
CollectionFeatureSource

protected class CollectionFeatureSource.SubCollection
extends DecoratingSimpleFeatureCollection

SubCollection for CollectionFeatureSource.

Will route any calls refining the feature collection back to CollectionFeatureSource. This is based on the success of ContentFeatureCollection.

Author:
Jody

Field Summary
 
Fields inherited from class DecoratingSimpleFeatureCollection
delegate
 
Constructor Summary
protected CollectionFeatureSource.SubCollection(Query query, SimpleFeatureCollection features)
           
 
Method Summary
 SimpleFeatureCollection sort(SortBy order)
          Obtained sorted contents.
 SimpleFeatureCollection subCollection(Filter filter)
          SimpleFeatureCollection "view" indicated by provided filter.
 
Methods inherited from class DecoratingSimpleFeatureCollection
accepts, canDelegate, contains, containsAll, equals, features, getBounds, getID, getSchema, hashCode, isEmpty, size, toArray, toArray
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionFeatureSource.SubCollection

protected CollectionFeatureSource.SubCollection(Query query,
                                                SimpleFeatureCollection features)
Method Detail

subCollection

public SimpleFeatureCollection subCollection(Filter filter)
Description copied from interface: FeatureCollection
SimpleFeatureCollection "view" indicated by provided filter.

The contents of the returned SimpleFeatureCollection are determined by applying the provider Filter to the entire contents of this FeatureCollection. The result is "live" and modifications will be shared.

This method is used cut down on the number of filter based methods required for a useful SimpleFeatureCollection construct. The FeatureCollections returned really should be considered as a temporary "view" used to control the range of a removeAll, or modify operation.

Example Use:


 collection.subCollection( filter ).clear();
 
The above recommended use is agreement with the Collections API precident of List.subList( start, end ).

The results of subCollection:

Specified by:
subCollection in interface SimpleFeatureCollection
Specified by:
subCollection in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
Overrides:
subCollection in class DecoratingSimpleFeatureCollection
Returns:
SimpleFeatureCollection identified as subset.
See Also:
FeatureList

sort

public SimpleFeatureCollection sort(SortBy order)
Description copied from interface: FeatureCollection
Obtained sorted contents.

This method may not be supported by all implementations, consider the use of FeatureSource.features( Query ).

Specified by:
sort in interface SimpleFeatureCollection
Specified by:
sort in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
Overrides:
sort in class DecoratingSimpleFeatureCollection
Parameters:
order - Sort order
Returns:
FeatureCollection sorted in the indicated order


Copyright © 1996-2014 Geotools. All Rights Reserved.